Fix stack adjustment for x86 pop r16#8050
Conversation
Always pops operand size and then truncates to store in register
|
|
fuzyll
left a comment
There was a problem hiding this comment.
Sorry for the delay on this.
I was a little confused when starting to review this because I didn't think x86-64 had an r16. I now understand that this is fixing lifting for things like segment registers where the destination is smaller than width of the stack pop. Not some weird general-purpose register thing. 😛
I verified that stuff like pop fs and pop gs appear improved while stuff like pop ax and pop word [rax] seem unaffected and the code itself seems like a clean change. I also verified that the change to push appears to not change anything and is just a refactor.
Thanks for the PR!
Related to #4028
pop r16is lifted incorrectly and adjusts the stack by the wrong size:This PR changes the lifting to always pop the memory operand size and insert a
LLIL_LOW_PARTif the destination register size is different: