mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 14:20:17 +00:00
Demangle: Fix crash-on-invalid demangling of a module name with no underlying entity
This commit is contained in:
parent
c31af7cfe3
commit
6f5ecd089f
@ -2885,7 +2885,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseUnqualifiedName(
|
||||
Result = getDerived().parseOperatorName(State);
|
||||
}
|
||||
|
||||
if (Module)
|
||||
if (Result != nullptr && Module != nullptr)
|
||||
Result = make<ModuleEntity>(Module, Result);
|
||||
if (Result != nullptr)
|
||||
Result = getDerived().parseAbiTags(Result);
|
||||
|
@ -30172,6 +30172,7 @@ const char* invalid_cases[] =
|
||||
"_ZWDC3FOOEv",
|
||||
"_ZGI3Foo",
|
||||
"_ZGIW3Foov",
|
||||
"W1x",
|
||||
};
|
||||
|
||||
const unsigned NI = sizeof(invalid_cases) / sizeof(invalid_cases[0]);
|
||||
|
@ -2885,7 +2885,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseUnqualifiedName(
|
||||
Result = getDerived().parseOperatorName(State);
|
||||
}
|
||||
|
||||
if (Module)
|
||||
if (Result != nullptr && Module != nullptr)
|
||||
Result = make<ModuleEntity>(Module, Result);
|
||||
if (Result != nullptr)
|
||||
Result = getDerived().parseAbiTags(Result);
|
||||
|
Loading…
Reference in New Issue
Block a user