diff src/cpu/x86/vm/c1_Runtime1_x86.cpp @ 20702:b5eb829bbce1

8066900: Array Out Of Bounds Exception causes variable corruption Summary: Fix FP registers save/restore during exception handling Reviewed-by: kvn, vlivanov
author iveresov
date Tue, 09 Dec 2014 12:25:38 -0800
parents 55fb97c4c58d
children 7848fc12602b
line wrap: on
line diff
--- a/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Thu Dec 04 14:34:11 2014 +0100
+++ b/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Tue Dec 09 12:25:38 2014 -0800
@@ -675,7 +675,7 @@
   case handle_exception_nofpu_id:
   case handle_exception_id:
     // At this point all registers MAY be live.
-    oop_map = save_live_registers(sasm, 1 /*thread*/, id == handle_exception_nofpu_id);
+    oop_map = save_live_registers(sasm, 1 /*thread*/, id != handle_exception_nofpu_id);
     break;
   case handle_exception_from_callee_id: {
     // At this point all registers except exception oop (RAX) and
@@ -748,7 +748,7 @@
   case handle_exception_nofpu_id:
   case handle_exception_id:
     // Restore the registers that were saved at the beginning.
-    restore_live_registers(sasm, id == handle_exception_nofpu_id);
+    restore_live_registers(sasm, id != handle_exception_nofpu_id);
     break;
   case handle_exception_from_callee_id:
     // WIN64_ONLY: No need to add frame::arg_reg_save_area_bytes to SP