This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Fix handling of labels in getLValueElement
ClosedPublic

Authored by alexander-shaposhnikov on Oct 22 2017, 7:36 PM.

Details

Summary

In getLValueElement Base may represent the address of a label (as in the newly-added test case),
in this case it's not a loc::MemRegionVal and Base.castAs<loc::MemRegionVal>() triggers an assert.

P.S. It also fixes the old bug reported here https://bugs.llvm.org/show_bug.cgi?id=11611

Test plan: make check-all

Diff Detail

Repository
rL LLVM

Event Timeline

alexander-shaposhnikov edited the summary of this revision. (Show Details)Oct 22 2017, 7:40 PM
alexander-shaposhnikov retitled this revision from [analyzer] Fix handling of labels getLValueElement to [analyzer] Fix handling of labels in getLValueElement .Oct 22 2017, 7:51 PM
NoQ accepted this revision.Oct 23 2017, 12:36 AM

Great. Probably one more reason to turn all Locs into regions.

This revision is now accepted and ready to land.Oct 23 2017, 12:36 AM
This revision was automatically updated to reflect the committed changes.