This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Improve modeling of static initializers.
ClosedPublic

Authored by ygribov on Nov 13 2015, 5:40 AM.

Details

Summary

Conversions between unrelated pointer types (e.g. char * and void *) involve bitcasts which were not properly modeled in case of static initializers. The patch fixes this problem.

The problem was originally spotted by Artem Dergachev.

Diff Detail

Repository
rL LLVM

Event Timeline

ygribov updated this revision to Diff 40144.Nov 13 2015, 5:40 AM
ygribov retitled this revision from to [analyzer] Improve modeling of static initializers..
ygribov updated this object.
ygribov added a subscriber: cfe-commits.
zaks.anna added inline comments.Nov 17 2015, 5:22 PM
test/Analysis/inline.cpp
308 ↗(On Diff #40144)

Why are we checking that the first element is not '0'?

ygribov added inline comments.Nov 17 2015, 8:45 PM
test/Analysis/inline.cpp
308 ↗(On Diff #40144)

We could check s[0] as well, there is no difference actually.

This revision was automatically updated to reflect the committed changes.
zaks.anna edited edge metadata.Nov 18 2015, 5:29 PM

Fixed and committed.

test/Analysis/inline.cpp
308 ↗(On Diff #40144)

Why we are checking for non-equality to '0' instead of checking for equality to 'b'?

ygribov added inline comments.Nov 18 2015, 10:20 PM
test/Analysis/inline.cpp
308 ↗(On Diff #40144)

Ah yeah, that would be more precise.