From 7d3b20d4fbe9f1bbe24aa249c2e4591feae4a381 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Fri, 25 Jan 2013 11:57:21 -0600 Subject: [PATCH] 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. --- src/Expr.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Expr.cc b/src/Expr.cc index 9e71f27897..96ff79bb59 100644 --- a/src/Expr.cc +++ b/src/Expr.cc @@ -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 )