harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r464074 - /incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp
Date Sun, 15 Oct 2006 00:02:54 GMT
Author: geirm
Date: Sat Oct 14 17:02:53 2006
New Revision: 464074

URL: http://svn.apache.org/viewvc?view=rev&rev=464074
Log:
HARMONY-1814

Implementation of Compiler::gen_magic() contains a bug.
If resolution of class is failed in vm_resolve_class_new() the function is_magic(klass) will
fail on assertion:

java: /nfs/pb/home/ivstolya/SVN/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp:524:
const char* 
class_get_name(
Class*): Assertion `cl' failed.

Ubuntu 6 - testcase, smoke, c-unit, ~kernel


Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp?view=diff&rev=464074&r1=464073&r2=464074
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/magics.cpp Sat Oct 14 17:02:53
2006
@@ -41,12 +41,15 @@
 {
     static const char unboxedName[] = "org/vmmagic/unboxed/";
     static const unsigned nameLen = sizeof(unboxedName)-1;
+
+    assert(k!=NULL);
     const char * kname = class_get_name(k);
     return !strncmp(kname, unboxedName, nameLen);
 }
 
 bool is_magic(Method_Handle m)
 {
+    assert(m != NULL);
     Class_Handle klass = method_get_class(m);
     return is_magic(klass);
 }
@@ -57,8 +60,8 @@
         1, //i8,
         2, //i16, 
         2, //u16,
-        4, //i32,
         8, //i64,
+        4, //i32,
         4, //flt32,
         8, //dbl64,
         4, //jobj,
@@ -98,7 +101,7 @@
         // trying to create a magic instance ?
         Class_Handle klass = NULL;
         klass = vm_resolve_class_new(m_compileHandle, m_klass, jinst.op0);
-        if (!is_magic(klass)) {
+        if (klass == NULL || !is_magic(klass)) {
             // not a magic - proceed as usual
             return false;
         }



Mime
View raw message