]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.power64] gc: fix etype of strings
authorAustin Clements <austin@google.com>
Thu, 6 Nov 2014 19:37:39 +0000 (14:37 -0500)
committerAustin Clements <austin@google.com>
Thu, 6 Nov 2014 19:37:39 +0000 (14:37 -0500)
The etype of references to strings was being incorrectly set
to TINT32 on all platforms.  Change it to TSTRING.  It seems
this doesn't matter for compilation, since x86 uses LEA
instructions to load string addresses and arm and power64
disassemble the string into its constituent pieces (with the
correct types), but it helps when debugging.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/170100043

src/cmd/5g/gobj.c
src/cmd/6g/gobj.c
src/cmd/8g/gobj.c
src/cmd/9g/gobj.c

index 5e988878f7d58e4efe8f078fdbfea9be41501291..65f731685e6eac2ed129bcdf4a237740a7c40323 100644 (file)
@@ -86,7 +86,7 @@ datagostring(Strlit *sval, Addr *a)
        sym = stringsym(sval->s, sval->len);
        a->type = D_OREG;
        a->name = D_EXTERN;
-       a->etype = TINT32;
+       a->etype = TSTRING;
        a->offset = 0;  // header
        a->reg = NREG;
        a->sym = linksym(sym);
index 04e837b1384ac59105d6aece7123a0ca89f22529..dbb4ff62c488aad7b3d46ceecc91f77f04861ade 100644 (file)
@@ -81,7 +81,7 @@ datagostring(Strlit *sval, Addr *a)
        a->sym = linksym(sym);
        a->node = sym->def;
        a->offset = 0;  // header
-       a->etype = TINT32;
+       a->etype = TSTRING;
 }
 
 void
index fa0605e6c763522f18b0feefb432799f709d1908..af287f702349df87c1afe619ffcc8233d5e16985 100644 (file)
@@ -81,7 +81,7 @@ datagostring(Strlit *sval, Addr *a)
        a->sym = linksym(sym);
        a->node = sym->def;
        a->offset = 0;  // header
-       a->etype = TINT32;
+       a->etype = TSTRING;
 }
 
 void
index fdd7606bcdf1d677246d21dfee62a46c1ae410c9..3da55878a763c379845a2530e88e603309547ea4 100644 (file)
@@ -89,7 +89,7 @@ datagostring(Strlit *sval, Addr *a)
        a->reg = NREG;
        a->node = sym->def;
        a->offset = 0;  // header
-       a->etype = TINT32;
+       a->etype = TSTRING;
 }
 
 void