Fix runaway reference counting bug in record coercion.

The RecordVal ctor refs the type arg via the MutableVal -> Val ctors,
so this line was double incrementing the type's ref count, but could
only decrement it once upon the Val's destruction.
This commit is contained in:
Jon Siwek 2013-01-25 11:57:21 -06:00
parent b72fbaf99f
commit 7d3b20d4fb

View file

@ -3967,7 +3967,7 @@ RecordCoerceExpr::~RecordCoerceExpr()
Val* RecordCoerceExpr::Fold(Val* v) const
{
RecordVal* val = new RecordVal(Type()->Ref()->AsRecordType());
RecordVal* val = new RecordVal(Type()->AsRecordType());
RecordVal* rv = v->AsRecordVal();
for ( int i = 0; i < map_size; ++i )