about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-04-01T12·04+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-04-01T12·04+0000
commit7b851915bfbad1c561191a037a2924d2b3d2d398 (patch)
tree6505b7773c1117295d2b00a244379f741a20a915 /src/libexpr/eval.cc
parent95cc417d76f7d374ef63e0b49a2f83e7b9202b0c (diff)
* Improve sharing.
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 53e57ff0894f..49aeb0036863 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -264,7 +264,7 @@ void EvalState::cloneAttrs(Value & src, Value & dst)
 {
     mkAttrs(dst);
     foreach (Bindings::iterator, i, *src.attrs)
-        (*dst.attrs)[i->first] = i->second; // !!! sharing?
+        mkCopy((*dst.attrs)[i->first], i->second);
 }
 
 
@@ -601,8 +601,7 @@ void EvalState::callFunction(Value & fun, Value & arg, Value & v)
                 mkThunk(v, env2, def);
             } else {
                 attrsUsed++;
-                v.type = tCopy;
-                v.val = &j->second;
+                mkCopy(v, j->second);
             }
         }