]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/5l: fix handling of RET.EQ in wrapper function
authorRuss Cox <rsc@golang.org>
Fri, 13 Sep 2013 03:50:50 +0000 (03:50 +0000)
committerRuss Cox <rsc@golang.org>
Fri, 13 Sep 2013 03:50:50 +0000 (03:50 +0000)
Keith is too clever for me.

R=ken2
CC=golang-dev, khr
https://golang.org/cl/13272050

src/cmd/5l/noop.c

index 0bd76040d3505feada2fc771d23ef24e16f91c89..fb70599b514951ec60533faea0f6cf9339c59fa4 100644 (file)
@@ -321,6 +321,13 @@ noops(void)
                                }
 
                                if(cursym->text->reg & WRAPPER) {
+                                       int cond;
+                                       
+                                       // Preserve original RET's cond, to allow RET.EQ
+                                       // in the implementation of reflect.call.
+                                       cond = p->scond;
+                                       p->scond = C_SCOND_NONE;
+
                                        // g->panicwrap -= autosize;
                                        // MOVW panicwrap_offset(g), R3
                                        // SUB $autosize, R3
@@ -347,6 +354,8 @@ noops(void)
                                        p->to.reg = REGG;
                                        p->to.offset = 2*PtrSize;
                                        p = appendp(p);
+
+                                       p->scond = cond;
                                }
 
                                p->as = AMOVW;