GaloisInc / macaw

Open source binary analysis tools.
BSD 3-Clause "New" or "Revised" License
208 stars 21 forks source link

`macaw-base`: `assertPred` does not handle its `isTrue` argument correctly for equalities #424

Closed Ptival closed 3 months ago

Ptival commented 3 months ago

https://github.com/GaloisInc/macaw/blob/07db1bad5912404aa32993f5258113451f02b8d8/base/src/Data/Macaw/AbsDomain/JumpBounds.hs#L681-L686

assertPred is supposed to enforce that its condition is true when its isTrue argument is True, and that it is false otherwise.

However, in the Eq case, it always enforces that the condition is true. This leads to false rejection of branches which cascades into even more annoying errors.

I will propose a fix soon.

I'm not sure whether it's easy to set a regression for this.

Ptival commented 3 months ago

Fixed via #425 ( 9e61b39f985201606a13389e38f0f558a01c5dc0 )