This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Fix SAT solver crashes on `X ^ X` and `X v X`
ClosedPublic

Authored by gribozavr on Jul 25 2022, 2:53 PM.

Details

Summary

BooleanFormula::addClause has an invariant that a clause has no duplicated
literals. When the solver was desugaring a formula into CNF clauses, it
could construct a clause with such duplicated literals in two cases.

Diff Detail

Event Timeline

gribozavr created this revision.Jul 25 2022, 2:53 PM
Herald added a project: Restricted Project. · View Herald Transcript
gribozavr requested review of this revision.Jul 25 2022, 2:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 25 2022, 2:53 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
xazax.hun accepted this revision.Jul 25 2022, 3:21 PM
This revision is now accepted and ready to land.Jul 25 2022, 3:21 PM
ymandel accepted this revision.Jul 25 2022, 4:47 PM
sgatev accepted this revision.Jul 25 2022, 11:29 PM
sgatev added inline comments.
clang/lib/Analysis/FlowSensitive/WatchedLiteralsSolver.cpp
273

Let's visit C->getLeftSubValue() here.

gribozavr updated this revision to Diff 447609.Jul 26 2022, 1:15 AM

Actually visit a subexpression

This revision was landed with ongoing or failed builds.Jul 26 2022, 1:26 AM
This revision was automatically updated to reflect the committed changes.