[vmkit-commits] [vmkit] r58937 - /vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Sun Nov 9 09:04:45 PST 2008


Author: geoffray
Date: Sun Nov  9 11:04:45 2008
New Revision: 58937

URL: http://llvm.org/viewvc/llvm-project?rev=58937&view=rev
Log:
Fix asserts in the case for static compilation.


Modified:
    vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp

Modified: vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp?rev=58937&r1=58936&r2=58937&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp Sun Nov  9 11:04:45 2008
@@ -152,7 +152,7 @@
     
     JavaObject* obj = isStaticCompiling() ? 0 : 
       cl->getClassDelegatee(JavaThread::get()->isolate);
-    assert(obj && "Delegatee not created");
+    assert((obj || isStaticCompiling()) && "Delegatee not created");
     Constant* cons = 
       ConstantExpr::getIntToPtr(ConstantInt::get(Type::Int64Ty, uint64(obj)),
                                 JnjvmModule::JavaObjectType);
@@ -175,7 +175,8 @@
     LLVMClassInfo* LCI = getClassInfo(classDef);
     LCI->getStaticType();
     JavaObject* obj = ((Class*)classDef)->getStaticInstance();
-    assert(obj && "Getting static instance before it's created!");
+    assert((obj || isStaticCompiling()) && 
+           "Getting static instance before it's created!");
     Constant* cons = 
       ConstantExpr::getIntToPtr(ConstantInt::get(Type::Int64Ty,
                                 uint64_t (obj)), JnjvmModule::JavaObjectType);
@@ -201,7 +202,8 @@
       LLVMClassInfo* LCI = getClassInfo((Class*)classDef);
       LCI->getVirtualType();
     }
-    assert(classDef->virtualVT && "Virtual VT not created");
+    assert((classDef->virtualVT || isStaticCompiling()) && 
+           "Virtual VT not created");
     Constant* cons = 
       ConstantExpr::getIntToPtr(ConstantInt::get(Type::Int64Ty,
                                                  uint64_t(classDef->virtualVT)),
@@ -227,7 +229,7 @@
     LLVMSignatureInfo* LSI = getSignatureInfo(meth->getSignature());
     const llvm::Type* valPtrType = LSI->getNativePtrType();
     
-    assert(ptr && "No native function given");
+    assert((ptr || isStaticCompiling()) && "No native function given");
 
     Constant* cons = 
       ConstantExpr::getIntToPtr(ConstantInt::get(Type::Int64Ty, uint64_t(ptr)),





More information about the vmkit-commits mailing list