[clang] [clang][bytecode] Stack-allocate bottom function frame (PR #125253)
Jorge Gorbe Moya via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 31 17:11:45 PST 2025
================
@@ -27,7 +27,7 @@ bool InterpState::inConstantContext() const {
}
InterpState::~InterpState() {
- while (Current) {
+ while (Current && !Current->isBottomFrame()) {
----------------
slackito wrote:
This is causing use-after-destruction errors for me when running clang tests under MemorySanitizer.
If I understand correctly, after the body of `~EvalEmitter()` finishes running, its members are destroyed in reverse order of declaration, and `BottomFrame` gets destroyed before the destructor for `InterpState S;` runs.
https://github.com/llvm/llvm-project/pull/125253
More information about the cfe-commits
mailing list