-
Notifications
You must be signed in to change notification settings - Fork 87
Fix overflow and dead branch warnings in Juliet tests #346
Copy link
Copy link
Closed
Description
We had a bachelor's student look at Goblint's behavior on Juliet suite and he also created some simplified tests, which I committed here in 91d3513.
None of them pass for various reasons, but since #338 it would be possible to add CWE-specific warnings:
- Interval analysis only warns about signed overflow, since that's what SV-COMP wanted, but now we should also warn (with different tags) about unsigned overflow.
- We don't distinguish overflow from underflow, but CWE does. For precise warnings we should as well.
- Even if temporarily removing the
isSignedcheck, we don't warn aboutcharoverflows. Probably because arithmetic withcharis performed asintand then cast back. So overflow in cast should warn as well. -
dbg.print_dead_codeprints some warnings about always true/false conditions, but they have the wrong location: they are printed at the first dead line in the branch body, not theifitself. I guess technically for Juliet suite it doesn't matter (?), but it would indeed make more sense to print it at theifsince the warning contains the expression. - Conditional expression evaluation sometimes is less precise than
invariant. Dead branch warnings are printed based on the former, but in 50/08 nothing is printed despite the body being a dead node. Apparently it only becomes dead after refining usinginvariant. This is semi-intentional:invariantis more expensive thaneval_rv(on base), so all of its logic maybe shouldn't be fallback foreval_rv. - Always true condition warnings aren't printed when the
ifhas no else branch or it is empty. Dead branch warnings are somehow tracked separately but also checked using dead lines (?). Since there's no dead node/line in the else branch, this is not detected, despitebranchraisingDeadcode.
Reactions are currently unavailable