You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
parsers: parse2: fix: also emit expr32 if count perfectly divisible by 1024
expr1024 requires expr32, but a build_count of 1024 would emit only the expr1024 rule and rely on luck of it being emitted somewhere else. Emit expr32 rule either if there is a expr32 use or a expr1024 use to avoid.
This commit is contained in:
@@ -319,7 +319,7 @@ class Python2Parser(PythonParser):
|
||||
build_count = token.attr
|
||||
thousands = build_count // 1024
|
||||
thirty32s = (build_count // 32) % 32
|
||||
if thirty32s > 0:
|
||||
if thirty32s > 0 or thousands > 0:
|
||||
rule = "expr32 ::=%s" % (" expr" * 32)
|
||||
self.add_unique_rule(rule, opname_base, build_count, customize)
|
||||
if thousands > 0:
|
||||
|
@@ -844,7 +844,7 @@ class Python3Parser(PythonParser):
|
||||
build_count = token.attr
|
||||
thousands = build_count // 1024
|
||||
thirty32s = (build_count // 32) % 32
|
||||
if thirty32s > 0:
|
||||
if thirty32s > 0 or thousands > 0:
|
||||
rule = "expr32 ::=%s" % (" expr" * 32)
|
||||
self.add_unique_rule(rule, opname_base, build_count, customize)
|
||||
pass
|
||||
|
Reference in New Issue
Block a user