From cc856e2b95b8a25cb40c43dfe64bb97c855ef92a Mon Sep 17 00:00:00 2001 From: rocky Date: Mon, 18 Nov 2019 11:34:06 -0500 Subject: [PATCH] Refine 2.7 control flow reduction tests... for "iflastsmtl" and "and" --- uncompyle6/parsers/parse27.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/uncompyle6/parsers/parse27.py b/uncompyle6/parsers/parse27.py index a70f9031..a83eb278 100644 --- a/uncompyle6/parsers/parse27.py +++ b/uncompyle6/parsers/parse27.py @@ -248,6 +248,8 @@ class Python27Parser(Python2Parser): # an optimization where the "and" jump_false is back to a loop. jmp_false = ast[1] if jmp_false[0] == "POP_JUMP_IF_FALSE": + while (first < last and isinstance(tokens[last].offset, str)): + last -= 1 if jmp_false[0].attr < tokens[last].offset: return True @@ -295,7 +297,7 @@ class Python27Parser(Python2Parser): return True while (first < last and isinstance(tokens[last].offset, str)): last -= 1 - return jmp_false[0].attr < tokens[last].offset + return tokens[first].offset < jmp_false[0].attr < tokens[last].offset pass pass pass