Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix external/picosat undefined behaviour.
Keve committed 1 year ago
commit 991ba63eed6d3b1eb73a969b6dd39f020b35d301
parent 0fff8d9
2 files changed +6 -8
modified UndefinedBehaviour.suppress.in
@@ -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

\ No newline at end of file
+
# For syntax see: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#issue-suppression
+
#

\ No newline at end of file
modified external/picosat/picosat.c
@@ -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