diff options
| author | Jun Zhang <jun@junz.org> | 2022-07-23 13:55:10 +0800 |
|---|---|---|
| committer | Jun Zhang <jun@junz.org> | 2022-07-26 12:34:03 +0800 |
| commit | 58c94808450d0ec73bed38d1661314c1a3d56e2f (patch) | |
| tree | 93da07a7e8a405e574aa33e0d66f25282d0ae16b /clang/lib/CodeGen/CodeGenModule.cpp | |
| parent | cd953e4ffcfe63ce9133ff7037a2c54aeb9b7421 (diff) | |
[CodeGen] Consider MangleCtx when move lazy emission States
Also move MangleCtx when moving some lazy emission states in
CodeGenModule. Without this patch clang-repl hits an invalid address
access when passing `-Xcc -O2` flag.
Signed-off-by: Jun Zhang <jun@junz.org>
Differential Revision: https://reviews.llvm.org/D130420
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 101080b6fe13..29713a5d2b3b 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -7000,4 +7000,6 @@ void CodeGenModule::moveLazyEmissionStates(CodeGenModule *NewBuilder) { "Still have (unmerged) EmittedDeferredDecls deferred decls"); NewBuilder->EmittedDeferredDecls = std::move(EmittedDeferredDecls); + + NewBuilder->ABI->MangleCtx = std::move(ABI->MangleCtx); } |
