[llvm-branch-commits] [llvm-branch] r69325 - /llvm/branches/Apple/Dib/lib/ExecutionEngine/JIT/JIT.cpp

Bill Wendling isanbard at gmail.com
Thu Apr 16 16:31:57 PDT 2009


Author: void
Date: Thu Apr 16 18:31:57 2009
New Revision: 69325

URL: http://llvm.org/viewvc/llvm-project?rev=69325&view=rev
Log:
--- Merging (from foreign repository) r69314 into '.':
U    lib/ExecutionEngine/JIT/JIT.cpp

make sure to unlock keymgr if the JIT is created and destroyed, all
locks must be matched with unlocks.  Also, use calloc to allocate the
block so that it is properly zero'd.  Thanks to Nick Kledzik for
tracking this down.

Modified:
    llvm/branches/Apple/Dib/lib/ExecutionEngine/JIT/JIT.cpp

Modified: llvm/branches/Apple/Dib/lib/ExecutionEngine/JIT/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/ExecutionEngine/JIT/JIT.cpp?rev=69325&r1=69324&r2=69325&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/lib/ExecutionEngine/JIT/JIT.cpp (original)
+++ llvm/branches/Apple/Dib/lib/ExecutionEngine/JIT/JIT.cpp Thu Apr 16 18:31:57 2009
@@ -237,11 +237,9 @@
   // The key is created on demand, and libgcc creates it the first time an
   // exception occurs. Since we need the key to register frames, we create
   // it now.
-  if (!LOI) {
-    LOI = (LibgccObjectInfo*)malloc(sizeof(struct LibgccObjectInfo)); 
-    _keymgr_set_and_unlock_processwide_ptr(KEYMGR_GCC3_DW2_OBJ_LIST,
-                                           LOI);
-  }
+  if (!LOI)
+    LOI = (LibgccObjectInfo*)calloc(sizeof(struct LibgccObjectInfo), 1); 
+  _keymgr_set_and_unlock_processwide_ptr(KEYMGR_GCC3_DW2_OBJ_LIST, LOI);
   InstallExceptionTableRegister(DarwinRegisterFrame);
 #else
   InstallExceptionTableRegister(__register_frame);





More information about the llvm-branch-commits mailing list