OSDN Git Service

PR c++/43890
[pf3gnuchains/gcc-fork.git] / libjava / defineclass.cc
index c66fff8..4c4e0a7 100644 (file)
@@ -1,6 +1,7 @@
 // defineclass.cc - defining a class from .class format.
 
-/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006  Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+   Free Software Foundation
 
    This file is part of libgcj.
 
@@ -358,6 +359,8 @@ _Jv_DefineClass (jclass klass, jbyteArray data, jint offset, jint length,
 #define MINOR_1_4  0
 #define MAJOR_1_5 49
 #define MINOR_1_5  0
+#define MAJOR_1_6 50
+#define MINOR_1_6  0
 
 void
 _Jv_ClassReader::parse ()
@@ -368,10 +371,10 @@ _Jv_ClassReader::parse ()
 
   int minor_version = read2u ();
   int major_version = read2u ();
-  if (major_version < MAJOR_1_1 || major_version > MAJOR_1_5
-      || (major_version == MAJOR_1_5 && minor_version > MINOR_1_5))
+  if (major_version < MAJOR_1_1 || major_version > MAJOR_1_6
+      || (major_version == MAJOR_1_6 && minor_version > MINOR_1_6))
     throw_class_format_error ("unrecognized class file version");
-  is_15 = (major_version == MAJOR_1_5);
+  is_15 = (major_version >= MAJOR_1_5);
 
   pool_count = read2u ();
 
@@ -1008,11 +1011,10 @@ void _Jv_ClassReader::read_one_code_attribute (int method_index)
                                
       for (int i = 0; i < table_len; i++)
         {
-          table[i].bytecode_start_pc = read2u ();
+          table[i].bytecode_pc = read2u ();
           table[i].length = read2u ();
-          int len;
-          len = pool_Utf8_to_char_arr (read2u (), &table[i].name);
-          len = pool_Utf8_to_char_arr (read2u (), &table[i].descriptor);
+          pool_Utf8_to_char_arr (read2u (), &table[i].name);
+          pool_Utf8_to_char_arr (read2u (), &table[i].descriptor);
           table[i].slot = read2u ();
           
           if (table[i].slot > method->max_locals || table[i].slot < 0)
@@ -1680,7 +1682,9 @@ void _Jv_ClassReader::handleCodeAttribute
   method->prepared       = NULL;
   method->line_table_len = 0;
   method->line_table     = NULL;
-
+#ifdef DIRECT_THREADED
+  method->thread_count   = 0;
+#endif
 
   // grab the byte code!
   memcpy ((void*) method->bytecode (),
@@ -1695,7 +1699,7 @@ void _Jv_ClassReader::handleCodeAttribute
       // call a static method of an interpreted class from precompiled
       // code without first resolving the class (that will happen
       // during class initialization instead).
-      method->self->ncode = method->ncode ();
+      method->self->ncode = method->ncode (def);
     }
 }
 
@@ -1740,7 +1744,7 @@ void _Jv_ClassReader::handleMethodsEnd ()
                  // interpreted class from precompiled code without
                  // first resolving the class (that will happen
                  // during class initialization instead).
-                 method->ncode = m->ncode ();
+                 method->ncode = m->ncode (def);
                }
            }
        }