[vmkit-commits] [vmkit] r69442 - /vmkit/trunk/lib/JnJVM/Compiler/ExceptionsCheck.inc

Nicolas Geoffray nicolas.geoffray at lip6.fr
Sat Apr 18 05:54:59 PDT 2009


Author: geoffray
Date: Sat Apr 18 07:54:42 2009
New Revision: 69442

URL: http://llvm.org/viewvc/llvm-project?rev=69442&view=rev
Log:
As it turns out, a readnone function may return 0 (what if the application
direclty calls finalize?). So do an extra check that there is indeed an
exception.


Modified:
    vmkit/trunk/lib/JnJVM/Compiler/ExceptionsCheck.inc

Modified: vmkit/trunk/lib/JnJVM/Compiler/ExceptionsCheck.inc
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/ExceptionsCheck.inc?rev=69442&r1=69441&r2=69442&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/Compiler/ExceptionsCheck.inc (original)
+++ vmkit/trunk/lib/JnJVM/Compiler/ExceptionsCheck.inc Sat Apr 18 07:54:42 2009
@@ -31,6 +31,8 @@
         F == module->GetClassDelegateeFunction) {
       test = new BitCastInst(res, module->JavaObjectType, "", currentBlock);
       test = new ICmpInst(ICmpInst::ICMP_EQ, test, obj, "", currentBlock);
+      Value* T = new ICmpInst(ICmpInst::ICMP_NE, obj, zero, "", currentBlock);
+      test = BinaryOperator::CreateAnd(test, T, "", currentBlock);
     } else {
       test = new ICmpInst(ICmpInst::ICMP_NE, obj, zero, "", currentBlock);
     }
@@ -77,6 +79,8 @@
         F == module->GetClassDelegateeFunction) {
       test = new BitCastInst(res, module->JavaObjectType, "", currentBlock);
       test = new ICmpInst(ICmpInst::ICMP_EQ, test, obj, "", currentBlock);
+      Value* T = new ICmpInst(ICmpInst::ICMP_NE, obj, zero, "", currentBlock);
+      test = BinaryOperator::CreateAnd(test, T, "", currentBlock);
     } else {
       test = new ICmpInst(ICmpInst::ICMP_NE, obj, zero, "", currentBlock);
     }
@@ -124,6 +128,8 @@
         F == module->GetClassDelegateeFunction) {
       test = new BitCastInst(res, module->JavaObjectType, "", currentBlock);
       test = new ICmpInst(ICmpInst::ICMP_EQ, test, obj, "", currentBlock);
+      Value* T = new ICmpInst(ICmpInst::ICMP_NE, obj, zero, "", currentBlock);
+      test = BinaryOperator::CreateAnd(test, T, "", currentBlock);
     } else {
       test = new ICmpInst(ICmpInst::ICMP_NE, obj, zero, "", currentBlock);
     }
@@ -168,6 +174,8 @@
         F == module->GetClassDelegateeFunction) {
       test = new BitCastInst(res, module->JavaObjectType, "", currentBlock);
       test = new ICmpInst(ICmpInst::ICMP_EQ, test, obj, "", currentBlock);
+      Value* T = new ICmpInst(ICmpInst::ICMP_NE, obj, zero, "", currentBlock);
+      test = BinaryOperator::CreateAnd(test, T, "", currentBlock);
     } else {
       test = new ICmpInst(ICmpInst::ICMP_NE, obj, zero, "", currentBlock);
     }





More information about the vmkit-commits mailing list