This is an archive of the discontinued LLVM Phabricator instance.

Fix for LValueReference cast segfault in Consumed.cpp
ClosedPublic

Authored by chris.wailes on Oct 30 2013, 11:00 AM.

Details

Summary

Fix for bugs 17632 and 17724.

The isLValueReferenceType function checks to see if the QualType's canonical type is an LValueReferenceType, and not if the QualType itself is an LValueReferenceType. This caused a segfault when trying to cast the QualType's Type to a LValueReferenceType. This is now fixed by casting the result of getCanonicalType().

In addition, a test was added to isConsumableType to prevent segfaults when a type being tested by the analysis is a reference to a pointer or a pointer to a reference.

Link to bugs:
http://llvm.org/bugs/show_bug.cgi?id=17632
http://llvm.org/bugs/show_bug.cgi?id=17724

Diff Detail

Event Timeline

dblaikie accepted this revision.Apr 5 2014, 5:02 PM

Committed in 193751

dblaikie closed this revision.Apr 5 2014, 5:03 PM