about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-07-11T10·29+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-07-11T10·29+0000
commite10b830251af37951109113d88ddf203ae95645c (patch)
treee9774a7e0c3d2e79732c524036e629cf9d28f876 /src
parent2b4b0658fa3f959f3b25dc75a3aa0a9814e63962 (diff)
* Doh! Of couse we cannot memoize across scopes.
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/nixexpr.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index ebdef96d9ce5..cce8edc39bec 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -229,16 +229,19 @@ static void checkVarDefs2(set<Expr> & done, const ATermMap & defs, Expr e)
         }
         for (ATermIterator i(formals); i; ++i) {
             Expr deflt;
+            set<Expr> done2;
             if (matchDefFormal(*i, name, deflt))
-                checkVarDefs2(done, defs2, deflt);
+                checkVarDefs2(done2, defs2, deflt);
         }
-        checkVarDefs2(done, defs2, body);
+        set<Expr> done2;
+        checkVarDefs2(done2, defs2, body);
     }
         
     else if (matchFunction1(e, name, body, pos)) {
         ATermMap defs2(defs);
         defs2.set(name, (ATerm) ATempty);
-        checkVarDefs2(done, defs2, body);
+        set<Expr> done2;
+        checkVarDefs2(done2, defs2, body);
     }
         
     else if (matchRec(e, rbnds, nrbnds)) {
@@ -252,7 +255,8 @@ static void checkVarDefs2(set<Expr> & done, const ATermMap & defs, Expr e)
             if (!matchBind(*i, name, value, pos)) abort(); /* can't happen */
             defs2.set(name, (ATerm) ATempty);
         }
-        checkVarDefs2(done, defs2, (ATerm) rbnds);
+        set<Expr> done2;
+        checkVarDefs2(done2, defs2, (ATerm) rbnds);
     }
 
     else if (matchWith(e, with, body, pos)) {