Skip to content

Commit

Permalink
Add support for bytecode version 95
Browse files Browse the repository at this point in the history
  • Loading branch information
p1-mmr committed Apr 20, 2023
1 parent 7cb34f7 commit 16f9ac4
Show file tree
Hide file tree
Showing 6 changed files with 1,616 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/parsers/hbc_bytecode_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from io import BytesIO

# Imports relative to the current directory:
from hbc_opcodes import hbc51, hbc58, hbc59, hbc61, hbc62, hbc68, hbc69, hbc70, hbc72, hbc73, hbc76, hbc80, hbc81, hbc82, hbc83, hbc84, hbc85, hbc86, hbc87, hbc89, hbc90, hbc92
from hbc_opcodes import hbc51, hbc58, hbc59, hbc61, hbc62, hbc68, hbc69, hbc70, hbc72, hbc73, hbc76, hbc80, hbc81, hbc82, hbc83, hbc84, hbc85, hbc86, hbc87, hbc89, hbc90, hbc92, hbc95
from serialized_literal_parser import unpack_slp_array, SLPArray, SLPValue, TagType
from hbc_opcodes.def_classes import OperandMeaning, Instruction

Expand Down Expand Up @@ -112,14 +112,15 @@ def get_parser(bytecode_version : int) -> 'module':
# days from their introduction in the Git tree, into a
# new version 93, and reintroduced in version 94.
93: hbc90,
94: hbc92
94: hbc92,
95: hbc95
}

if bytecode_version < 72:
warning('This file uses an ancient Hermes bytecode format, which ' +
'is not supported.')

elif bytecode_version > 94:
elif bytecode_version > 95:
warning(('Bytecode version %d corresponds to a development or ' +
'recent version of the Hermes bytecode and is not ' +
'formally supported by the current tool.') % bytecode_version)
Expand Down
Loading

0 comments on commit 16f9ac4

Please sign in to comment.