From 90db0f9ad78c03fd2f720b6771345db02883fc64 Mon Sep 17 00:00:00 2001
From: Frederic Parain <fparain@openjdk.org>
Date: Fri, 12 Aug 2016 08:46:17 -0700
Subject: [PATCH] 8146697: VM crashes in test Test7005594

Reviewed-by: coleenp, dholmes
---
 hotspot/src/cpu/x86/vm/interp_masm_x86.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp
index 15cf1f751a7..f3ae96f05a1 100644
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp
@@ -1071,6 +1071,9 @@ void InterpreterMacroAssembler::remove_activation(
 
     NOT_LP64(get_thread(rthread);)
 
+    cmpl(Address(rthread, JavaThread::stack_guard_state_offset()), JavaThread::stack_guard_enabled);
+    jcc(Assembler::equal, no_reserved_zone_enabling);
+
     cmpptr(rbx, Address(rthread, JavaThread::reserved_stack_activation_offset()));
     jcc(Assembler::lessEqual, no_reserved_zone_enabling);