diff options
author | Oleksandr T. <oleksandr.tarasiuk@outlook.com> | 2024-12-02 18:16:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-02 18:16:47 +0200 |
commit | 071da9261b7e94c2d2d4e9d3d4eba1f29115e8ae (patch) | |
tree | 8ceecc90b32c6dfaa400667633a15172b31a7e14 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 97f94af3560d3ae046f6c3d7ec74b03d1d2493d0 (diff) | |
download | llvm-071da9261b7e94c2d2d4e9d3d4eba1f29115e8ae.zip llvm-071da9261b7e94c2d2d4e9d3d4eba1f29115e8ae.tar.gz llvm-071da9261b7e94c2d2d4e9d3d4eba1f29115e8ae.tar.bz2 |
[Clang] ensure mangled names are valid identifiers before being suggested in ifunc/alias attributes notes (#118170)
Fixes #112205
---
Commit that introduced this feature -
https://github.com/llvm/llvm-project/commit/9306ef9750b7a319d59f6d3e4977e01e39b8f161
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 7189a46..d3d5c07 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -602,7 +602,8 @@ static bool checkAliasedGlobal( // mangled name. for (const auto &[Decl, Name] : MangledDeclNames) { if (const auto *ND = dyn_cast<NamedDecl>(Decl.getDecl())) { - if (ND->getName() == GV->getName()) { + IdentifierInfo *II = ND->getIdentifier(); + if (II && II->getName() == GV->getName()) { Diags.Report(Location, diag::note_alias_mangled_name_alternative) << Name << FixItHint::CreateReplacement( |