aboutsummaryrefslogtreecommitdiff
path: root/src/cpu/x86/vm/interp_masm_x86_64.cpp
diff options
context:
space:
mode:
authormgerdin <none@none>2013-10-30 15:35:25 +0100
committermgerdin <none@none>2013-10-30 15:35:25 +0100
commitff6bc2546ea06a918263e09ab292f68713f6c942 (patch)
tree5062e590e270a6478658ef8d2d44431c223d4957 /src/cpu/x86/vm/interp_masm_x86_64.cpp
parent61f9de8d3a9a81401e693aa6b68d0840cd63af12 (diff)
downloadjdk8u_hotspot-ff6bc2546ea06a918263e09ab292f68713f6c942.tar.gz
8027252: Crash in interpreter because get_unsigned_2_byte_index_at_bcp reads 4 bytes
Summary: Use 2-byte loads to load indexes from the byte code stream to avoid out of bounds reads. Reviewed-by: coleenp, sspitsyn
Diffstat (limited to 'src/cpu/x86/vm/interp_masm_x86_64.cpp')
-rw-r--r--src/cpu/x86/vm/interp_masm_x86_64.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cpu/x86/vm/interp_masm_x86_64.cpp b/src/cpu/x86/vm/interp_masm_x86_64.cpp
index 7758d8fbc..520c872a6 100644
--- a/src/cpu/x86/vm/interp_masm_x86_64.cpp
+++ b/src/cpu/x86/vm/interp_masm_x86_64.cpp
@@ -192,7 +192,7 @@ 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(r13, bcp_offset));
+ load_unsigned_short(reg, Address(r13, bcp_offset));
bswapl(reg);
shrl(reg, 16);
}