Hi Seungbeom,
Thanks again for the patch. I applied it in r154256:
http://llvm.org/viewvc/llvm-project?rev=154256&view=rev
Best,
Cristian
On 03/02/2012 11:38 AM, Cristian Cadar wrote:
> Hi Seungbeom,
>
> Many thanks for the patch. Would it be possible to also send a small
> test case to make sure we won't be running into this issue again?
>
> Cristian
>
> On 02/29/2012 11:12 PM, Seungbeom Kim wrote:
>> Hello,
>>
>> The current implementation of ref<T> incorrectly decrements the reference
>> count first and destroys the T object in self-assignment of ref<T> when
>> it was the only reference.
>>
>> ref<Expr> r(new Expr...);
>> r = r; // BANG!
>>
>> This looks like a contrived example, but can happen in subtle cases:
>>
>> void f(ref<Expr>& a, ref<Expr>& b) { ... a = b; ... }
>> // ...
>> f(r, r);
>>
>> The correct way to do it is to increment the reference count of the RHS
>> object before decrementing that of the LHS object, as given in the patch.
>>
>> Thanks,
>>
>>
>>
>>
>> _______________________________________________
>> klee-commits mailing list
>> [email protected]
>> http://keeda.Stanford.EDU/mailman/listinfo/klee-commits
> _______________________________________________
> klee-commits mailing list
> [email protected]
> http://keeda.Stanford.EDU/mailman/listinfo/klee-commits
_______________________________________________
klee-dev mailing list
[email protected]
http://keeda.Stanford.EDU/mailman/listinfo/klee-dev