aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2014-03-09 14:41:02 -0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-03-10 10:14:50 +0100
commit049a379ec6ca755bcc077fd0e8da186ff76b8679 (patch)
tree66552a4997d66ce61d87f822d96b8786fe0c62e4 /src/libexpr/eval.cc
parent908e9ce259710037ae9824a3246143e46e27e867 (diff)
The expr of AttrNames/DynamicAttrDefs is always an ExprConcatStrings
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 730b431cf..04c3418a0 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -642,15 +642,13 @@ void ExprAttrs::eval(EvalState & state, Env & env, Value & v)
/* dynamic attrs apply *after* rec and __overrides */
foreach (DynamicAttrDefs::iterator, i, dynamicAttrs) {
Value nameVal;
- assert(dynamic_cast<ExprConcatStrings *>(i->nameExpr));
- ExprConcatStrings * nameExpr = static_cast<ExprConcatStrings *>(i->nameExpr);
- if (nameExpr->es->size() == 1) {
- nameExpr->es->front()->eval(state, *dynamicEnv, nameVal);
+ if (i->nameExpr->es->size() == 1) {
+ i->nameExpr->es->front()->eval(state, *dynamicEnv, nameVal);
state.forceValue(nameVal);
if (nameVal.type == tNull)
continue;
}
- nameExpr->eval(state, *dynamicEnv, nameVal);
+ i->nameExpr->eval(state, *dynamicEnv, nameVal);
state.forceStringNoCtx(nameVal);
Symbol nameSym = state.symbols.create(nameVal.string.s);
Bindings::iterator j = v.attrs->find(nameSym);