Fixing ref'counting problem.

This commit is contained in:
Robin Sommer 2011-08-15 20:56:59 -07:00
parent 2af9d9bc20
commit f9cd97d78d
2 changed files with 2 additions and 4 deletions

@ -1 +1 @@
Subproject commit c39622855e3c3a5cc94c7376f86184ed1db1939a Subproject commit ad8dfaba0c0c784060aa6f0c5e1fcf62244b1a51

View file

@ -5022,13 +5022,11 @@ Val* ListExpr::InitVal(const BroType* t, Val* aggr) const
Expr* e = exprs[i]; Expr* e = exprs[i];
check_and_promote_expr(e, vec->Type()->AsVectorType()->YieldType()); check_and_promote_expr(e, vec->Type()->AsVectorType()->YieldType());
Val* v = e->Eval(0); Val* v = e->Eval(0);
if ( ! vec->Assign(i, v->RefCnt() == 1 ? v->Ref() : v, e) ) if ( ! vec->Assign(i, v, e) )
{ {
e->Error(fmt("type mismatch at index %d", i)); e->Error(fmt("type mismatch at index %d", i));
return 0; return 0;
} }
Unref(v);
} }
return aggr; return aggr;