fixup_static() locks on appropriate compilation units so we must not
call it with cu mutex lock.

Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
---
 jit/trampoline.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/jit/trampoline.c b/jit/trampoline.c
index 880a899..122b58a 100644
--- a/jit/trampoline.c
+++ b/jit/trampoline.c
@@ -139,15 +139,16 @@ void *jit_magic_trampoline(struct compilation_unit *cu)
         * Therefore, do fixup for direct call sites unconditionally and fixup
         * vtables if method can be invoked via invokevirtual.
         */
-       if (ret) {
+       if (ret)
                fixup_direct_calls(method->trampoline, (unsigned long) ret);
 
-               if (vm_method_is_static(cu->method))
-                       fixup_static(cu->method->class);
-       }
-
        pthread_mutex_unlock(&cu->mutex);
 
+       /* XXX: this must be done with cu->mutex unlocked because fixup_static()
+        * might need to lock it. */
+       if (ret && vm_method_is_static(cu->method))
+               fixup_static(cu->method->class);
+
        return ret;
 }
 
-- 
1.6.0.6


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to