mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8027252: Crash in interpreter because get_unsigned_2_byte_index_at_bcp reads 4 bytes
Use 2-byte loads to load indexes from the byte code stream to avoid out of bounds reads. Reviewed-by: coleenp, sspitsyn
This commit is contained in:
parent
3e0a2a86bf
commit
0b4ed553d6
4 changed files with 14 additions and 6 deletions
|
@ -196,7 +196,7 @@ void InterpreterMacroAssembler::check_and_handle_earlyret(Register java_thread)
|
|||
|
||||
void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset) {
|
||||
assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode");
|
||||
movl(reg, Address(rsi, bcp_offset));
|
||||
load_unsigned_short(reg, Address(rsi, bcp_offset));
|
||||
bswapl(reg);
|
||||
shrl(reg, 16);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue