Skip to content

reject negative unnamed-type numbers in ParseUnnamedTypeName#2115

Open
nabhan06 wants to merge 1 commit into
abseil:masterfrom
nabhan06:demangle-unnamed-type-negative
Open

reject negative unnamed-type numbers in ParseUnnamedTypeName#2115
nabhan06 wants to merge 1 commit into
abseil:masterfrom
nabhan06:demangle-unnamed-type-negative

Conversation

@nabhan06

Copy link
Copy Markdown
Contributor

ParseUnnamedTypeName bounds the unnamed-type <number> only from above, so a negative one (from the n prefix, or from ParseNumber truncating its accumulator to int) still reaches MaybeAppendDecimal, which documents a positive value and evaluates (val % 10) + '0' per digit, emitting bytes below '0' -- _ZUtn3_ demangles to {unnamed type#/} and _ZUt2147483648_ to {unnamed type#./,),(-*,*}, both returning true -- so add the matching lower bound on both the Ut and Ul branches, keeping the -1 sentinel that denotes an omitted number, the same straining ParseLocalNameSuffix already does for <(parameter) number>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant