wibiti/uncompyle2 — Issue #8: Expeculated IF/ELIF related function decompiling failure
Author: bloodyshade
Created: 2012-02-08 22:31:22+00:00
State: open

Hi,

I want to report an issue I've noticed recently and it seems to be related to IF/ELIF statements without ELSE.
For example:

win32com.decimal_23:695-699
if not res:
return 0
elif res._sign:
return -1
return 1

disassembly:

430 LOAD_FAST 'res'
433 POP_JUMP_IF_TRUE '440'
436 LOAD_CONST ''
439 RETURN_VALUE ''
440 LOAD_FAST 'res'
443 LOAD_ATTR '_sign'
446 POP_JUMP_IF_FALSE '453'
449 LOAD_CONST -1
452 RETURN_VALUE ''
453 LOAD_CONST 1
456 RETURN_VALUE ''
-1 RETURN_LAST ''

Syntax error at or near `RETURN_VALUE' token at offset 456

I also had similar problems with the following files: twisted.python.reflect, twisted.internet.process and pkg_resources.
Though in twisted.internet.process it seems to be related to a try/except block inside a try block, but not really sure.

Regards,
Luis Henrique Sestari Rocha