angr/pyvex

Confusing error message when pyvex fails to import

Closed this issue · 1 comments

If pyvex fails to import, archinfo/arch.py sets _pyvex to None (line 13). The rest of the code is very careful to check that _pyvex is not None before using it, except line 188, which references _pyvex without first checking that it is not None. As a result, a failed import of pyvex gives the error message 'AttributeError: 'NoneType' object has no attribute 'vex_ffi' on line 188, which is a very confusing way to say "pyvex failed to import". I'm not sure whether the proper fix is to simply move the two lines 188-189 inside the if-block which begins at line 191? or if something more complicated is needed. If the former, I'm happy to put up a PR.

I'm sorry, this issue was supposed to be on the angr/archinfo repo