You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Fix pypy semantic action bug in CALL_METHOD
This commit is contained in:
BIN
test/bytecode_pypy2.7/02_call_method.pyc
Normal file
BIN
test/bytecode_pypy2.7/02_call_method.pyc
Normal file
Binary file not shown.
4
test/simple_source/bug_pypy27/02_call_method.py
Normal file
4
test/simple_source/bug_pypy27/02_call_method.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# Bug in PyPy was not hacndling CALL_METHOD_xxx like
|
||||||
|
# CALL_FUNCTION_XXX
|
||||||
|
def truncate(self, size=None):
|
||||||
|
self.db.put(self.key, '', txn=self.txn, dlen=self.len - size, doff=size)
|
@@ -1730,8 +1730,7 @@ class SourceWalker(GenericASTTraversal, object):
|
|||||||
%c, %C, and so on.
|
%c, %C, and so on.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# self.println("-----")
|
# self.println("----> ", startnode.type)
|
||||||
# self.print(startnode)
|
|
||||||
|
|
||||||
fmt = entry[0]
|
fmt = entry[0]
|
||||||
arg = 1
|
arg = 1
|
||||||
@@ -1850,11 +1849,10 @@ class SourceWalker(GenericASTTraversal, object):
|
|||||||
continue
|
continue
|
||||||
op = k[ :k.rfind('_') ]
|
op = k[ :k.rfind('_') ]
|
||||||
|
|
||||||
if k == 'CALL_METHOD':
|
if k.startswith('CALL_METHOD'):
|
||||||
# This happens in PyPy only
|
# This happens in PyPy only
|
||||||
TABLE_R[k] = ('%c(%P)', 0, (1, -1, ', ', 100))
|
TABLE_R[k] = ('%c(%P)', 0, (1, -1, ', ', 100))
|
||||||
|
elif op == 'CALL_FUNCTION':
|
||||||
if op == 'CALL_FUNCTION':
|
|
||||||
TABLE_R[k] = ('%c(%P)', 0, (1, -1, ', ', 100))
|
TABLE_R[k] = ('%c(%P)', 0, (1, -1, ', ', 100))
|
||||||
elif op in ('CALL_FUNCTION_VAR',
|
elif op in ('CALL_FUNCTION_VAR',
|
||||||
'CALL_FUNCTION_VAR_KW', 'CALL_FUNCTION_KW'):
|
'CALL_FUNCTION_VAR_KW', 'CALL_FUNCTION_KW'):
|
||||||
|
Reference in New Issue
Block a user