diff src/cpu/x86/vm/methodHandles_x86.cpp @ 3937:c565834fb592

7088020: SEGV in JNIHandleBlock::release_block Reviewed-by: kvn, twisti
author never
date Sat, 10 Sep 2011 00:11:04 -0700
parents c26de9aef2ed
children 0abefdb54d21
line wrap: on
line diff
--- a/src/cpu/x86/vm/methodHandles_x86.cpp	Fri Sep 09 13:47:11 2011 -0700
+++ b/src/cpu/x86/vm/methodHandles_x86.cpp	Sat Sep 10 00:11:04 2011 -0700
@@ -624,6 +624,11 @@
 
   // error path for invokeExact (only)
   __ bind(invoke_exact_error_path);
+  // ensure that the top of stack is properly aligned.
+  __ mov(rdi, rsp);
+  __ andptr(rsp, -StackAlignmentInBytes); // Align the stack for the ABI
+  __ pushptr(Address(rdi, 0));  // Pick up the return address
+
   // Stub wants expected type in rax and the actual type in rcx
   __ jump(ExternalAddress(StubRoutines::throw_WrongMethodTypeException_entry()));