shithub: mc

Download patch

ref: ee4f263f0c410a8e1061ff704054f8707cb0cb0c
parent: 12df9f45f4f383a6bdf8939b44a3b499edee853e
author: Ori Bernstein <[email protected]>
date: Sun Jul 12 19:20:51 EDT 2015

Loop patterns are patterns.

    As a result, we need to push the scope
    where the variable is declared.

    Let's do that.

--- a/parse/specialize.c
+++ b/parse/specialize.c
@@ -195,7 +195,9 @@
             fixup(n->loopstmt.body);
             break;
         case Niterstmt:
+            pushstab(n->iterstmt.body->block.scope);
             fixup(n->iterstmt.elt);
+            popstab();
             fixup(n->iterstmt.seq);
             fixup(n->iterstmt.body);
             break;