hotspot/src/share/vm/interpreter/interpreterRuntime.hpp
changeset 360 21d113ecbf6a
parent 1 489c9b5090e2
child 670 ddf3e9583f2f
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp	Fri Apr 11 09:56:35 2008 -0400
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp	Sun Apr 13 17:43:42 2008 -0400
@@ -35,7 +35,10 @@
   static methodOop method(JavaThread *thread)        { return last_frame(thread).interpreter_frame_method(); }
   static address   bcp(JavaThread *thread)           { return last_frame(thread).interpreter_frame_bcp(); }
   static void      set_bcp_and_mdp(address bcp, JavaThread*thread);
-  static Bytecodes::Code code(JavaThread *thread)       { return Bytecodes::code_at(bcp(thread)); }
+  static Bytecodes::Code code(JavaThread *thread)    {
+    // pass method to avoid calling unsafe bcp_to_method (partial fix 4926272)
+    return Bytecodes::code_at(bcp(thread), method(thread));
+  }
   static bool      already_resolved(JavaThread *thread) { return cache_entry(thread)->is_resolved(code(thread)); }
   static int       one_byte_index(JavaThread *thread)   { return bcp(thread)[1]; }
   static int       two_byte_index(JavaThread *thread)   { return Bytes::get_Java_u2(bcp(thread) + 1); }