bugs 29, 61, 62, 74
fixedbugs 49 now (correctly) fails
bugs 32, 41, 68, 77 shouldnt be bugs
R=r
OCL=14842
CL=14842
diff --git a/src/cmd/6g/cgen.c b/src/cmd/6g/cgen.c
index f85b8e4..e128dab 100644
--- a/src/cmd/6g/cgen.c
+++ b/src/cmd/6g/cgen.c
@@ -172,9 +172,17 @@
if(isptrto(nl->type, TSTRING)) {
regalloc(&n1, types[tptr], res);
cgen(nl, &n1);
+
+ nodconst(&n2, types[tptr], 0);
+ gins(optoas(OCMP, types[tptr]), &n1, &n2);
+ p1 = gbranch(optoas(OEQ, types[tptr]), T);
+
n1.op = OINDREG;
n1.type = types[TINT32];
gmove(&n1, res);
+
+ patch(p1, pc);
+
regfree(&n1);
break;
}