shithub: mc

Download patch

ref: d47d4ee1be3d12dfde55d0b2a42c75c4cb57d51d
parent: 7eaa7298de834db0a52563f653ca316118fc889d
author: Ori Bernstein <[email protected]>
date: Tue Jan 3 20:36:00 EST 2012

Make stabs at appropriate places.

--- a/parse/gram.y
+++ b/parse/gram.y
@@ -523,7 +523,7 @@
 blockbody
         : stmt
             {
-                $$ = mkblock(line, NULL);
+                $$ = mkblock(line, mkstab(curscope));
                 nlappend(&$$->block.stmts, &$$->block.nstmts, $1);
             }
         | blockbody stmt
--- a/parse/node.c
+++ b/parse/node.c
@@ -103,6 +103,7 @@
     f->func.args = args;
     f->func.nargs = nargs;
     f->func.body = body;
+    f->func.scope = mkstab(curscope);
 
     n = mknode(line, Nlit);
     n->lit.littype = Lfunc;