Index: src/x64/regexp-macro-assembler-x64.cc |
diff --git a/src/x64/regexp-macro-assembler-x64.cc b/src/x64/regexp-macro-assembler-x64.cc |
index 55fabc00364491618fc1c594e59ee99566b35a5f..1e0cd6a38c0a7b607c442dcdb475a3583991b898 100644 |
--- a/src/x64/regexp-macro-assembler-x64.cc |
+++ b/src/x64/regexp-macro-assembler-x64.cc |
@@ -1248,6 +1248,11 @@ int RegExpMacroAssemblerX64::CheckStackGuardState(Address* return_address, |
frame_entry<const String*>(re_frame, kInputString) = *subject; |
frame_entry<const byte*>(re_frame, kInputStart) = new_address; |
frame_entry<const byte*>(re_frame, kInputEnd) = new_address + byte_length; |
+ } else if (frame_entry<const String*>(re_frame, kInputString) != *subject) { |
+ // Subject string might have been a ConsString that underwent |
+ // short-circuiting during GC. That will not change start_address but |
+ // will change pointer inside the subject handle. |
+ frame_entry<const String*>(re_frame, kInputString) = *subject; |
} |
return 0; |