diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-02-28 19:23:54 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-02-28 19:23:54 +0100 |
commit | 03ae4fa162221c0828e273fa2fe57d0347ef0f15 (patch) | |
tree | 037d3a451e11040a287446c9d68dd62e4df5fee6 /sys | |
parent | 8b72726549be9e816ca8af0b9489948cc4fccb41 (diff) |
6c: fix 32bit pointer truncation (from patch/6c-sugen-types)
1. Go group spotted that a slightly-obscured pointer move was done by AMOVL not AMOVQ.
2. Inspecting the code further, I noticed that other pointer types were set to TLONG not TIND,
causing similar truncation of pointers to 32 bits.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/src/cmd/6c/cgen.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/src/cmd/6c/cgen.c b/sys/src/cmd/6c/cgen.c index 5e6b10b33..6b1e94185 100644 --- a/sys/src/cmd/6c/cgen.c +++ b/sys/src/cmd/6c/cgen.c @@ -1596,7 +1596,7 @@ copy: regsalloc(&nod2, nn); nn->type = t; - gins(AMOVL, &nod1, &nod2); + gins(AMOVQ, &nod1, &nod2); regfree(&nod1); nod2.type = typ(TIND, t); @@ -1697,7 +1697,7 @@ copy: c = 0; if(n->complex > nn->complex) { t = n->type; - n->type = types[TLONG]; + n->type = types[TIND]; nodreg(&nod1, n, D_SI); if(reg[D_SI]) { gins(APUSHQ, &nod1, Z); @@ -1708,7 +1708,7 @@ copy: n->type = t; t = nn->type; - nn->type = types[TLONG]; + nn->type = types[TIND]; nodreg(&nod2, nn, D_DI); if(reg[D_DI]) { warn(Z, "DI botch"); @@ -1720,7 +1720,7 @@ warn(Z, "DI botch"); nn->type = t; } else { t = nn->type; - nn->type = types[TLONG]; + nn->type = types[TIND]; nodreg(&nod2, nn, D_DI); if(reg[D_DI]) { warn(Z, "DI botch"); @@ -1732,7 +1732,7 @@ warn(Z, "DI botch"); nn->type = t; t = n->type; - n->type = types[TLONG]; + n->type = types[TIND]; nodreg(&nod1, n, D_SI); if(reg[D_SI]) { gins(APUSHQ, &nod1, Z); |