Skip to content

Commit 4ad58b8

Browse files
demangle: an omitted subobject selector is 0
1 parent 3a20b6d commit 4ad58b8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cases_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30176,7 +30176,6 @@ var casesExpectedFailures = map[string]bool{
3017630176
"_ZN1XIZ1fIiEvOT_EUlOT_DpT0_E_EclIJEEEvDpT_": true,
3017730177
"_ZN1XIZ1fIiEvOT_EUlS2_DpT0_E_EclIJEEEvDpT_": true,
3017830178
"_ZZZZN6abcdef9abcdefghi29abcdefabcdefabcdefabcefabcdef27xxxxxxxxxxxxxxxxxxxxxxxxxxxEN4absl8DurationERKNSt3__u12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEPNS1_19yyyyyyyyyyyyyyyyyyyEENK3$_5clEvENKUlvE_clEvE6zzzzzz": true,
30179-
"_Z1fIXtl1BadsoiL_Z6nestedE_EEEEvv": true,
3018030179
"_Z1fIXtl1BcvPiplcvPcadL_Z7derivedELl16EEEEvv": true,
3018130180
"_Z1fIXtl1Edi1nLi42EEEEvv": true,
3018230181
"_Z1h1XIJZ1fIiEDaOT_E1AZ1gIdEDaS2_E1BEE": true,

demangle.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2219,7 +2219,10 @@ func (st *state) subobject() AST {
22192219
var selectors []int
22202220
for len(st.str) > 0 && st.str[0] == '_' {
22212221
st.advance(1)
2222-
selector := st.number()
2222+
selector := 0
2223+
if len(st.str) > 0 && (st.str[0] == 'n' || isDigit(st.str[0])) {
2224+
selector = st.number()
2225+
}
22232226
selectors = append(selectors, selector)
22242227
}
22252228
pastEnd := false

0 commit comments

Comments
 (0)