[vmkit-commits] [vmkit] r86376 - /vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Sat Nov 7 07:48:29 PST 2009


Author: geoffray
Date: Sat Nov  7 09:48:29 2009
New Revision: 86376

URL: http://llvm.org/viewvc/llvm-project?rev=86376&view=rev
Log:
Bugfix when parsing the static GC map.


Modified:
    vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp

Modified: vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp?rev=86376&r1=86375&r2=86376&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp (original)
+++ vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp Sat Nov  7 09:48:29 2009
@@ -114,23 +114,16 @@
       if (!currentFrame->ReturnAddress) break;
       int res = dladdr(currentFrame->ReturnAddress, &info);
       if (res) {
-        if (previousPtr) {
-          if (info.dli_saddr == previousPtr) {
-            previousFrame = currentFrame;
-          } else {
-            StaticCamlMethodInfo* MI =
-              new(StaticAllocator, "StaticCamlMethodInfo")
-              StaticCamlMethodInfo(previousFrame, previousPtr, previousName);
-            previousName = info.dli_sname;
-            previousFrame = currentFrame;
-            previousPtr = info.dli_saddr;
-            addMethodInfo(MI, previousPtr);
-          }
-        } else {
-          previousName = info.dli_sname;
-          previousFrame = currentFrame;
+        if (previousPtr && info.dli_saddr != previousPtr) {
+          StaticCamlMethodInfo* MI =
+            new(StaticAllocator, "StaticCamlMethodInfo")
+            StaticCamlMethodInfo(previousFrame, previousPtr, previousName);
+          addMethodInfo(MI, previousPtr);
         }
-      }   
+        previousName = info.dli_sname;
+        previousFrame = currentFrame;
+        previousPtr = info.dli_saddr;
+      }
 
       currentFrame = (CamlFrame*) ((char*)currentFrame + 
         (currentFrame->NumLiveOffsets % 2) * sizeof(uint16_t) +
@@ -143,7 +136,7 @@
 CamlMethodInfo::CamlMethodInfo(CamlFrame* C, void* ip) {
   if (!C) {
     MethodInfo* MI = VirtualMachine::SharedStaticFunctions.IPToMethodInfo(ip);
-    if (MI) {
+    if (MI != &DefaultMethodInfo::DM) {
       C = ((CamlMethodInfo*)MI)->CF;
     }
   }





More information about the vmkit-commits mailing list