[WinEH] Reset WinEHPrepare::SEHExceptionCodeSlot when we're done.
This caused a use-after-free on test/CodeGen/X86/win32-eh.ll
No functional change intended.
llvm-svn: 236561
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp
index db91c02..2c72a55 100644
--- a/llvm/lib/CodeGen/WinEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -934,6 +934,7 @@
CleanupHandlerMap.clear();
HandlerToParentFP.clear();
DT = nullptr;
+ SEHExceptionCodeSlot = nullptr;
return HandlersOutlined;
}