From e10b830251af37951109113d88ddf203ae95645c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 11 Jul 2006 10:29:52 +0000 Subject: [PATCH] * Doh! Of couse we cannot memoize across scopes. --- src/libexpr/nixexpr.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc index ebdef96d9..cce8edc39 100644 --- a/src/libexpr/nixexpr.cc +++ b/src/libexpr/nixexpr.cc @@ -229,16 +229,19 @@ static void checkVarDefs2(set & done, const ATermMap & defs, Expr e) } for (ATermIterator i(formals); i; ++i) { Expr deflt; + set done2; if (matchDefFormal(*i, name, deflt)) - checkVarDefs2(done, defs2, deflt); + checkVarDefs2(done2, defs2, deflt); } - checkVarDefs2(done, defs2, body); + set 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 done2; + checkVarDefs2(done2, defs2, body); } else if (matchRec(e, rbnds, nrbnds)) { @@ -252,7 +255,8 @@ static void checkVarDefs2(set & 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 done2; + checkVarDefs2(done2, defs2, (ATerm) rbnds); } else if (matchWith(e, with, body, pos)) {