[vmkit-commits] [PATCH] Fix logic assumption that having the class for a method means its resolved.

Will Dietz wdietz2 at illinois.edu
Tue Nov 29 07:17:46 PST 2011


Inlined below.

I'm not sure about this, but if you look higher in the code we set
"canBeDirect" in the case that we a)got a class for the method and
b)that class is final.

This doesn't necessarily mean the method is non-null (potentially
because the class isn't resolved?), and as such we shouldn't call
canBeInlined on the method.

~Will

>From 12dbeb52ee9bb07d226dc98fa114e36099fdd1a8 Mon Sep 17 00:00:00 2001
From: Will Dietz <w at wdtz.org>
Date: Mon, 21 Nov 2011 12:10:53 -0600
Subject: [PATCH 1/2] Fix logic assumption that having the class for a method
 means its resolved.

---
 lib/j3/Compiler/JavaJIT.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/j3/Compiler/JavaJIT.cpp b/lib/j3/Compiler/JavaJIT.cpp
index 56cf094..39fa148 100644
--- a/lib/j3/Compiler/JavaJIT.cpp
+++ b/lib/j3/Compiler/JavaJIT.cpp
@@ -192,11 +192,11 @@ void JavaJIT::invokeVirtual(uint16 index) {
   llvm::Type* retType = virtualType->getReturnType();

   bool needsInit = false;
-  if (canBeDirect && canBeInlined(meth, customized)) {
+  if (canBeDirect && meth && canBeInlined(meth, customized)) {
     makeArgs(it, index, args, signature->nbArguments + 1);
     if (!thisReference) JITVerifyNull(args[0]);
     val = invokeInline(meth, args, customized);
-  } else if (canBeDirect &&
+  } else if (canBeDirect && meth &&
       !TheCompiler->needsCallback(meth, customized ? customizeFor :
NULL, &needsInit)) {
     makeArgs(it, index, args, signature->nbArguments + 1);
     if (!thisReference) JITVerifyNull(args[0]);
-- 
1.7.5.1



More information about the vmkit-commits mailing list