Skip to content

Commit 6b8d076

Browse files
authored
[clang][bytecode] Return failure for dead non-temporary pointers (#125247)
... even when we're not performing a lvalue-to-rvalue conversion.
1 parent 9955d84 commit 6b8d076

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/AST/ByteCode/EvalEmitter.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ template <> bool EvalEmitter::emitRet<PT_Ptr>(const SourceInfo &Info) {
174174
return false;
175175
}
176176
} else {
177+
if (!Ptr.isLive() && !Ptr.isTemporary())
178+
return false;
179+
177180
EvalResult.setValue(Ptr.toAPValue(Ctx.getASTContext()));
178181
}
179182

0 commit comments

Comments
 (0)