Devin Coughlin
Devin Coughlin
Thanks for the report! This is fixed as of r255859. *** This bug has been marked as a duplicate of bug llvm/llvm-bugzilla-archive#25777 ***
mentioned in issue llvm/llvm-bugzilla-archive#25936
*** Bug llvm/llvm-bugzilla-archive#25936 has been marked as a duplicate of this bug. ***
Looks like this was introduced in r250237 ([Analyzer] Don’t invalidate CXXThis when conservatively evaluating const methods (PR 21606)). The assertion fires when ThisVal in CXXInstanceCall::getExtraInvalidatedValues() is Unknown.
This is the same as llvm/llvm-project#25288 . The underlying issue was fixed in r253157 *** This bug has been marked as a duplicate of bug llvm/llvm-project#25288 ***
Committed a fix in r254806.
Here is a simplified reproducer: struct Super { int field; }; struct Sub : Super {}; void foo(int &p) { Sub &s = (Sub &)(p); s.field = 2; }
rdar://problem/23682869
Reproduces on ToT with: ../build/clang-ninja/bin/clang -cc1 -analyze -analyzer-checker=core sa4.cc
George fixed this in r319834.