This is an archive of the discontinued LLVM Phabricator instance.

Attempt to fix up condition variables with temp dtors.
ClosedPublic

Authored by klimek on May 3 2014, 8:16 AM.

Details

Summary

I discovered this problem when playing around with slightly
different block split-ups when inserting temp dtors; a test
would fail with "garbage value accessed" warning. After following
some red herrings while debugging, I realized that the initializer
(MyClass c = ...) was after the temp destructor call (see the test
I had to fix). I just replaced the special-case logic in VisitIfStmt
with a call to addStmt, which invokes VisitDeclStmt, which already
handles all the temporary destructor logic correctly.
If you can come up with tests that this breaks, please let me know ;)

Diff Detail

Event Timeline

klimek updated this revision to Diff 9060.May 3 2014, 8:16 AM
klimek retitled this revision from to Attempt to fix up condition variables with temp dtors..
klimek updated this object.
klimek edited the test plan for this revision. (Show Details)
klimek added reviewers: krememek, jordan_rose.
klimek added subscribers: alexmc, Unknown Object (MLST).
klimek updated this revision to Diff 9065.May 5 2014, 4:13 AM

Simplify the condition.

jordan_rose accepted this revision.May 5 2014, 9:16 AM
jordan_rose edited edge metadata.

Good catch, LGTM.

This revision is now accepted and ready to land.May 5 2014, 9:16 AM
klimek closed this revision.May 23 2014, 11:46 PM