[WinEH] Reset WinEHPrepare::SEHExceptionCodeSlot when we're done.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 6 May 2015 01:28:58 +0000 (01:28 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 6 May 2015 01:28:58 +0000 (01:28 +0000)
This caused a use-after-free on test/CodeGen/X86/win32-eh.ll
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236561 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/WinEHPrepare.cpp

index db91c02ee461dcf7adb670b8e738b74c8700461a..2c72a556f75a28fde29adef20c948bac8dd0cfa4 100644 (file)
@@ -934,6 +934,7 @@ bool WinEHPrepare::prepareExceptionHandlers(
   CleanupHandlerMap.clear();
   HandlerToParentFP.clear();
   DT = nullptr;
+  SEHExceptionCodeSlot = nullptr;
 
   return HandlersOutlined;
 }