diff src/share/vm/interpreter/bytecodes.hpp @ 413:c7ec737733a6

6756528: Bytecodes::special_length_at reads past end of code buffer Summary: Add end-of-buffer indicator for paths used by the verifier Reviewed-by: acorn, coleenp
author kamg
date Thu, 30 Oct 2008 15:48:59 -0400
parents a61af66fc99e
children ad8c8ca4ab0f
line wrap: on
line diff
--- a/src/share/vm/interpreter/bytecodes.hpp	Wed Oct 22 20:47:00 2008 -0700
+++ b/src/share/vm/interpreter/bytecodes.hpp	Thu Oct 30 15:48:59 2008 -0400
@@ -340,8 +340,10 @@
     const char* wf = wide_format(code);
     return (wf == NULL) ? 0 : (int)strlen(wf);
   }
-  static int         special_length_at(address bcp);
-  static int         raw_special_length_at(address bcp);
+  // if 'end' is provided, it indicates the end of the code buffer which
+  // should not be read past when parsing.
+  static int         special_length_at(address bcp, address end = NULL);
+  static int         raw_special_length_at(address bcp, address end = NULL);
   static int         length_at      (address bcp)  { int l = length_for(code_at(bcp)); return l > 0 ? l : special_length_at(bcp); }
   static int         java_length_at (address bcp)  { int l = length_for(java_code_at(bcp)); return l > 0 ? l : special_length_at(bcp); }
   static bool        is_java_code   (Code code)    { return 0 <= code && code < number_of_java_codes; }