Missing context in Rust binary_op_lifter!
to check for correct size of expressions
#5913
Labels
Component: Rust API
Issue needs changes to the Rust API
Effort: Medium
Issue should take < 1 month
Impact: High
Issue adds or blocks important functionality
Type: Bug
Issue is a non-crashing bug with repro steps
Milestone
Version and Platform (required):
Bug Description:
In the Rust API, there are macros like
binary_op_lifter!
that are very strict about size checking. If you get it wrong, it will print something like this as a warning each time it's lifted incorrectly:il @ {:x} attempted to lift 4 byte expression builder as 0 bytes
This is very helpful when you are lifting as it can help you catch potential errors. Unfortunately, it's incredibly pedantic and isn't expressive enough for certain architectures. This means you can wind up with a ton of these messages and no way to resolve them when lifting.
The best example of this is in C-SKY comparison instructions (
cmp_{e,ne,slt,ult...}
) wherebinary_op_lifter!
treats the two source expressions and the destination instruction as the same size. This works in a lot of cases, but here the output of thecmp
is fed into aset_flag
operation that expects a size of 0. As a result, the warning is completely unavoidable.The text was updated successfully, but these errors were encountered: