-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when extending IRSBs #187
Comments
You mentioned this was resolved on slack, but can you provide a testcase to reproduce regardless? I want to understand the issue and maybe provide a better error message. |
Sorry for the delay. I could re-create the problem by using the following code:
` |
Yes, hm. This is definitely an issue. Block extension is a destructive operation on the second block, reusing the statement and expression objects as an optimization since the only usecase had previously been stitching together blocks from different lifters, where the goal was to produce one coherent block that would supercede any need to use either of the original blocks. @subwire @lockshaw what do you think of this? should there be a usecase for nondestructive extension or should we just document the caveat and move on? |
This issue has been marked as |
My program integrates C code and calls pyvex/angr through it. Within the C code I lift basic blocks to vex, and then combine basic blocks for indirect call/jump solving. When there are two preceding blocks to the same IRSB, pyvex gets a strange error when combining the second of the two blocks.
Although it says that the blocks have been combined (the program does not fail), attempting to pretty print the newly combined block will fail. Going statement by statement, pyvex only prints out the statement for the first instruction, but upon encountering the second statement
02 | t13 = GET:I64(rsp)
, I get the following error:enums.py:84: RuntimeWarning: tp_compare didn't return -1 or -2 for exception return ints_to_enums[i]
When manually getting the bytes of each block and combining them, it works without errors, but when calling the
extend
method the error will ariseEDIT: after adding
PyErr_Print
to the code: the error is:File "pyvex/block.py", line 211, in extend
stmt_.tmp = convert_tmp(stmt_.tmp)
File "pyvex/block.py", line 193, in convert_tmp
tmp_type = extendwith.tyenv.lookup(tmp)
File "pyvex/block.py", line 578, in lookup
return self.types[tmp]
IndexError: list index out of range
The text was updated successfully, but these errors were encountered: