<= 2.6 weird jump out of try block

Allow COME_FROMs to appare via JUMP_FORWARD in
tey/except blocks
This commit is contained in:
rocky
2016-06-30 06:21:13 -04:00
parent 7772243ac7
commit da9aeecc60
3 changed files with 15 additions and 2 deletions

Binary file not shown.

View File

@@ -0,0 +1,9 @@
# 2.6.9 cgi.py
# Bug in 2.6.9 was not detecting jump out of except from ValueError
def __getitem__(v):
if v:
try: return v
except ValueError:
try: return v
except ValueError: pass
return v

View File

@@ -502,9 +502,13 @@ class Scanner2(scan.Scanner):
'end': jmp+1})
i = jmp + 1
else:
if self.get_target(jmp) != start_else:
target = self.get_target(jmp)
if target != start_else:
end_else = self.get_target(jmp)
if self.code[jmp] == self.opc.JF:
if self.version <= 2.6:
self.fixed_jumps[jmp] = target
else:
self.fixed_jumps[jmp] = -1
self.structs.append({'type': 'except',
'start': i,