[llvm] [CodeGen][WinEH] Update saved esp for inlined inallocas (PR #116585)
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 19 09:45:52 PST 2024
================
@@ -774,3 +778,27 @@ void WinEHStatePass::insertStateNumberStore(Instruction *IP, int State) {
RegNode, StateFieldIndex);
Builder.CreateStore(Builder.getInt32(State), StateField);
}
+
+void WinEHStatePass::updateEspForInAllocas(Function &F) {
+ for (BasicBlock &BB : F) {
+ for (Instruction &I : BB) {
+ if (auto *Alloca = dyn_cast<AllocaInst>(&I)) {
+ if (!Alloca->isUsedWithInAlloca())
----------------
rnk wrote:
Regarding the security implications, I would just fix the miscompile. The on-stack exception handling records make this platform extremely easy to attack, and I can't say with confidence that LLVM has implemented all of the hardening techniques to protect the exception registration nodes in the FS:00 linked list.
https://github.com/llvm/llvm-project/pull/116585
More information about the llvm-commits
mailing list