shithub: mc

Download patch

ref: 2b4d970882a1d12750a4055e3f9eff5472c3abc1
parent: a09e11162f8ce238042e015b9a83e6966f73ed25
parent: 3aca4ae01d6cc83f83faeecb0271bf12b2db5722
author: Nayuki Minase <[email protected]>
date: Sun Aug 26 22:31:32 EDT 2012

Merge remote branch 'origin/master'

--- a/6/simp.c
+++ b/6/simp.c
@@ -523,9 +523,11 @@
 {
     size_t i;
 
+    pushstab(n->block.scope);
     for (i = 0; i < n->block.nstmts; i++) {
         simp(s, n->block.stmts[i]);
     }
+    popstab();
 }
 
 static Node *simplit(Simp *s, Node *lit, Node ***l, size_t *nl)
@@ -1263,7 +1265,9 @@
     /* unwrap to the function body */
     n = n->expr.args[0];
     n = n->lit.fnval;
+    pushstab(n->func.scope);
     flatten(s, n);
+    popstab();
 
     if (debug)
         for (i = 0; i < s->nstmts; i++)
@@ -1374,6 +1378,7 @@
     /* We need to define all global variables before use */
     fillglobls(file->file.globls, globls);
 
+    pushstab(file->file.globls);
     for (i = 0; i < file->file.nstmts; i++) {
         n = file->file.stmts[i];
         switch (n->type) {
@@ -1387,6 +1392,7 @@
                 break;
         }
     }
+    popstab();
 
     fd = fopen(out, "w");
     if (!fd)