summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-08-26 14:05:59 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-08-26 14:05:59 +0000
commit99dc3e613a2ce30474fff92151abf165d017c26d (patch)
tree5ba36264d98d0763f8b137bac238e6b20443f6fc
parentd06be428f6dd046c89a69995d5328b8250bec3d2 (diff)
downloadguix-99dc3e613a2ce30474fff92151abf165d017c26d.tar.gz
* Require that __overrides is defined as a non-recursive attribute
  (which means it can only be defined via "inherit"), otherwise we get
  scoping bugs, since __overrides can't be recursive (or at least, it
  would be hard).

-rw-r--r--src/libexpr/eval.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index ef1408b503..01d33ad00c 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -181,11 +181,11 @@ LocalNoInline(ATerm expandRec(EvalState & state, ATerm e, ATermList rbnds, ATerm
     ATermMap subs(ATgetLength(rbnds) + ATgetLength(nrbnds));
     for (ATermIterator i(rbnds); i; ++i) {
         if (!matchBind(*i, name, e2, pos)) abort(); /* can't happen */
-        if (name == sOverrides) eOverrides = e2;
         subs.set(name, makeSelect(e, name));
     }
     for (ATermIterator i(nrbnds); i; ++i) {
         if (!matchBind(*i, name, e2, pos)) abort(); /* can't happen */
+        if (name == sOverrides) eOverrides = e2;
         subs.set(name, e2);
     }