This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Fix crash in RangedConstraintManager.cpp
ClosedPublic

Authored by vabridgers on Mar 22 2022, 5:38 PM.

Details

Summary

This change fixes a crash in RangedConstraintManager.cpp:assumeSym due to an
unhandled BO_Div case.

clang: <root>clang/lib/StaticAnalyzer/Core/RangedConstraintManager.cpp:51:

virtual clang::ento::ProgramStateRef
clang::ento::RangedConstraintManager::assumeSym(clang::ento::ProgramStateRef,
  clang::ento::SymbolRef, bool):
Assertion `BinaryOperator::isComparisonOp(Op)' failed.

Diff Detail

Event Timeline

vabridgers created this revision.Mar 22 2022, 5:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2022, 5:38 PM
vabridgers requested review of this revision.Mar 22 2022, 5:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2022, 5:38 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

remove assert that was commented out

NoQ accepted this revision.Mar 22 2022, 10:05 PM

Thanks! I agree that this assertion doesn't make much sense. Judging by the name, the function should be able to handle all symbols.

clang/lib/StaticAnalyzer/Core/RangedConstraintManager.cpp
61

The new line break in the middle of a != b doesn't make much sense.

This revision is now accepted and ready to land.Mar 22 2022, 10:05 PM

update comment

vabridgers marked an inline comment as done.Mar 23 2022, 1:28 AM