This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Only attempt to get the value of locations of known type
ClosedPublic

Authored by george.karpenkov on Feb 26 2018, 7:36 PM.

Details

Summary

Fixes https://bugs.llvm.org/show_bug.cgi?id=36474

In general, getSVal API should be changed so that it does not crash on some non-obvious conditions.
It should either be updated to require a type, or to return Optional<SVal>.

Diff Detail

Repository
rL LLVM

Event Timeline

NoQ accepted this revision.Feb 26 2018, 7:43 PM
NoQ added inline comments.
lib/StaticAnalyzer/Checkers/NonnullGlobalConstantsChecker.cpp
78 ↗(On Diff #136027)

Pls explain why it would work correctly now?

test/Analysis/novoidtypecrash.c
1 ↗(On Diff #136027)

Add -verify just in case someone wants to add more checks into this file and doesn't notice that they don't fail before the patch?

This revision is now accepted and ready to land.Feb 26 2018, 7:43 PM
This revision was automatically updated to reflect the committed changes.