Skip to content

Commit 8eea478

Browse files
authored
[ItaniumDemangle] reject A-F in FP literals (#83061)
Sync this change to the copy of ItaniumDemangle.h in "llvm": #82864 The Itanium C++ ABI specifies that FP literals are encoded using a lowercase hexadecimal string. Previously, libc++abi allowed uppercase A-F characters but decoded them by subtracting 'a' from them, producing negative digit values. It is especially confusing to accept an 'E' digit because 'E' marks the end of the FP literal.
1 parent 4d04a40 commit 8eea478

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/Demangle/ItaniumDemangle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5540,7 +5540,7 @@ Node *AbstractManglingParser<Alloc, Derived>::parseFloatingLiteral() {
55405540
return nullptr;
55415541
std::string_view Data(First, N);
55425542
for (char C : Data)
5543-
if (!std::isxdigit(C))
5543+
if (!(C >= '0' && C <= '9') && !(C >= 'a' && C <= 'f'))
55445544
return nullptr;
55455545
First += N;
55465546
if (!consumeIf('E'))

0 commit comments

Comments
 (0)