File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,12 +50,16 @@ def _parse_jitlog(fileobj):
5050 If a ParseException is directly raised, this is an error that cannot
5151 be recovered from!
5252 """
53- is_jit_log = fileobj .read (1 ) == const .MARK_JITLOG_HEADER
54- version = ord (fileobj .read (1 )) | (ord (fileobj .read (1 )) << 8 )
55- is_32bit = ord (fileobj .read (1 ))
56- machine = read_string (fileobj , True )
57- forest = TraceForest (version , is_32bit , machine )
58- ctx = ParseContext (forest )
53+ try :
54+ is_jit_log = fileobj .read (1 ) == const .MARK_JITLOG_HEADER
55+ version = ord (fileobj .read (1 )) | (ord (fileobj .read (1 )) << 8 )
56+ is_32bit = ord (fileobj .read (1 ))
57+ machine = read_string (fileobj , True )
58+ forest = TraceForest (version , is_32bit , machine )
59+ ctx = ParseContext (forest )
60+ except Exception :
61+ raise ParseException ("Header malformed" )
62+ #
5963 if not is_jit_log :
6064 raise ParseException ("Missing header. Provided input might not be a jitlog!" )
6165 if version < JITLOG_MIN_VERSION :
You can’t perform that action at this time.
0 commit comments