GaloisInc / macaw

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

fix `assertPred` and make its code more uniform #425

Closed Ptival closed 3 months ago

Ptival commented 3 months ago

This is a fix for #424. The primary fix consists in splitting the logic for equality tests based on the value of isTrue. I have separated it as its own function as it's needed for two branches, and Haskell lacks binding or-patterns.

Along the way, I have made the code for assertPred better documented, and much more uniform. This should make it easier to spot bugs and understand the overall logic.