File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -251,7 +251,7 @@ class CvdumpTypesParser:
251251 LF_ENUM_NAME_RE = re .compile (r"^\s*enum name = (?P<name>.+)$" )
252252
253253 LF_ENUM_TYPES = re .compile (
254- r"^\s*type = (?P<underlying_type>\S+) field list type (?P<field_type>0x\w{4} )$"
254+ r"^\s*type = (?P<underlying_type>\S+) field list type (?P<field_type>0x\w+ )$"
255255 )
256256 LF_ENUM_UDT = re .compile (r"^\s*UDT\((?P<udt>0x\w+)\)$" )
257257 LF_UNION_LINE = re .compile (
Original file line number Diff line number Diff line change @@ -1051,6 +1051,21 @@ def test_type_keys_over_ffff(empty_parser: CvdumpTypesParser):
10511051 assert empty_parser .keys [TK (0x11738 )]["field_list_type" ] == TK (0x11737 )
10521052
10531053
1054+ BIG_ENUM_KEY_SAMPLE = """
1055+ 0x000105da : Length = 38, Leaf = 0x1507 LF_ENUM
1056+ # members = 68, type = T_INT4(0074) field list type 0x105d9
1057+ enum name = e_STATE_t, UDT(0x000105da)
1058+ """
1059+
1060+
1061+ def test_enum_keys_over_ffff (empty_parser : CvdumpTypesParser ):
1062+ """Make sure we can read an LF_ENUM if its field list type key is over 0xffff. (GH #318)"""
1063+ empty_parser .read_all (BIG_ENUM_KEY_SAMPLE )
1064+ assert empty_parser .keys [TK (0x105DA )]["field_list_type" ] == TK (0x105D9 )
1065+ assert empty_parser .keys [TK (0x105DA )]["underlying_type" ] == CVInfoTypeEnum .T_INT4
1066+ assert empty_parser .keys [TK (0x105DA )]["name" ] == "e_STATE_t"
1067+
1068+
10541069ARRAY_WITH_UNKNOWN_ELEMENT = """
105510700x1000 : Length = 14, Leaf = 0x1503 LF_ARRAY
10561071 Element type = ???(0555)
You can’t perform that action at this time.
0 commit comments