Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
410:8fb16f199266 | 413:c7ec737733a6 |
---|---|
338 return 0; | 338 return 0; |
339 } | 339 } |
340 const char* wf = wide_format(code); | 340 const char* wf = wide_format(code); |
341 return (wf == NULL) ? 0 : (int)strlen(wf); | 341 return (wf == NULL) ? 0 : (int)strlen(wf); |
342 } | 342 } |
343 static int special_length_at(address bcp); | 343 // if 'end' is provided, it indicates the end of the code buffer which |
344 static int raw_special_length_at(address bcp); | 344 // should not be read past when parsing. |
345 static int special_length_at(address bcp, address end = NULL); | |
346 static int raw_special_length_at(address bcp, address end = NULL); | |
345 static int length_at (address bcp) { int l = length_for(code_at(bcp)); return l > 0 ? l : special_length_at(bcp); } | 347 static int length_at (address bcp) { int l = length_for(code_at(bcp)); return l > 0 ? l : special_length_at(bcp); } |
346 static int java_length_at (address bcp) { int l = length_for(java_code_at(bcp)); return l > 0 ? l : special_length_at(bcp); } | 348 static int java_length_at (address bcp) { int l = length_for(java_code_at(bcp)); return l > 0 ? l : special_length_at(bcp); } |
347 static bool is_java_code (Code code) { return 0 <= code && code < number_of_java_codes; } | 349 static bool is_java_code (Code code) { return 0 <= code && code < number_of_java_codes; } |
348 | 350 |
349 static bool is_aload (Code code) { return (code == _aload || code == _aload_0 || code == _aload_1 | 351 static bool is_aload (Code code) { return (code == _aload || code == _aload_0 || code == _aload_1 |