This is an archive of the discontinued LLVM Phabricator instance.

Fixed double-free in case of module loading error.
ClosedPublic

Authored by tra on May 8 2015, 3:11 PM.

Details

Summary

GetOutputStream() owns the stream it returns pointer to and the
pointer should never be freed by us. When we fail to load and exit
early, unique_ptr still holds the pointer and frees it which leads to
compiler crash when CompilerInstance attempts to free it again.

Added regression test for failed bitcode linking.

Diff Detail

Repository
rL LLVM

Event Timeline

tra updated this revision to Diff 25374.May 8 2015, 3:11 PM
tra retitled this revision from to Fixed double-free in case of module loading error..
tra updated this object.
tra edited the test plan for this revision. (Show Details)
tra added reviewers: echristo, rnk, dblaikie.
tra added a subscriber: Unknown Object (MLST).
tra updated this revision to Diff 25375.May 8 2015, 3:30 PM

Use assignment to init the pointer.

rnk accepted this revision.May 11 2015, 4:30 PM
rnk edited edge metadata.

lgtm

This revision is now accepted and ready to land.May 11 2015, 4:30 PM
This revision was automatically updated to reflect the committed changes.