GaloisInc / macaw

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

support alignment ops when processing statements in `RegisterUse` #406

Closed Ptival closed 4 months ago

Ptival commented 4 months ago

For some reason we were very conservative in our support or abstract operations over the processor state in the RegisterUse analysis.

In particular, we were failing to process code such as:

r23 := (bv_and r21 (0xfffffffffffffff0 :: [64]))

whose goal is to align the value in r21 at a 16-byte boundary.

This resulted in us failing to analyze some code that was realigning its stack pointer. With this change, the same code succeeds at propagating the abstract stack pointer offset forward.

Ptival commented 4 months ago

@RyanGlScott I have addressed your comments, and also added two comments that I fell will help me if I ever need to look at this code again.