Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix external/picosat undefined behaviour. #2375

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions UndefinedBehaviour.suppress.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#
# These are errors that need to be taken care of, but in the sprit of
# "Put Your Own Oxygen Mask on First", we provide here a suppression list for
# _external_ sources.
# Suppress errors that are recognized but fix is considered beyond the scope of this project.
# (e.g. in external source).
#

# external/picosat/picosat.c:3432:33: runtime error: applying non-zero offset 8 to null pointer
# +SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior external/picosat/picosat.c:3432:33
pointer-overflow:picosat.c
# For syntax see: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#issue-suppression
#
3 changes: 2 additions & 1 deletion external/picosat/picosat.c
Original file line number Diff line number Diff line change
Expand Up @@ -3429,7 +3429,8 @@ satisfied (PS * ps)
return 0;
assert (!ps->conflict);
assert (bcp_queue_is_empty (ps));
return ps->thead == ps->trail + ps->max_var; /* all assigned */
return (ps->thead == ps->trail && 0 == ps->max_var)
|| (ps->trail && ps->thead == ps->trail + ps->max_var); /* all assigned */
}

static void
Expand Down
Loading