Skip to content

Commit 5801c74

Browse files
author
rocky
committed
Improve slightly graal 3.8 and 3.10 handling
1 parent 8e08a4a commit 5801c74

File tree

5 files changed

+763
-5
lines changed

5 files changed

+763
-5
lines changed

xdis/codetype/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def codeType2Portable(code, version_triple=PYTHON_VERSION_TRIPLE, is_graal: bool
104104
co_filename=code.co_filename,
105105
co_name=code.co_name,
106106
co_firstlineno=code.co_firstlineno,
107-
co_lnotab=co_lnotab,
107+
co_lnotab=line_table,
108108
version_triple=version_triple,
109109
other_fields=other_fields,
110110
)

xdis/codetype/code38.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def __init__(
112112
)
113113
self.co_posonlyargcount = co_posonlyargcount
114114
self.fieldtypes = Code38FieldTypes
115-
if type(self) is Code38:
115+
if isinstance(self, Code38):
116116
self.check()
117117

118118
def to_native(self) -> types.CodeType:

xdis/opcodes/opcode_310graal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def def_graal_op(
116116

117117
# Returns the value to the caller. In generators, performs generator return.
118118
# Pops: return value
119-
def_graal_op(opc, "RETURN_VALUE", 18, 0, 1, 0)
119+
def_graal_op(opc, "RETURN_VALUE", 0x12, 0, 1, 0)
120120
#
121121
# Reads a name from locals dict, globals or builtins determined by the
122122
# immediate operand which indexes the names array ({@code co_names}).
@@ -320,7 +320,7 @@ def def_graal_op(
320320

321321
# Loads signed byte from immediate operand.
322322
#
323-
def_graal_op(opc, "LOAD_BYTE", 56, 1, 0, 1)
323+
def_graal_op(opc, "LOAD_BYTE", 0x70, 1, 0, 1)
324324
#
325325
# Loads {@code int} from primitiveConstants array indexed by the immediate operand.
326326
#

0 commit comments

Comments
 (0)