Index: src/builtins/s390/builtins-s390.cc |
diff --git a/src/builtins/s390/builtins-s390.cc b/src/builtins/s390/builtins-s390.cc |
index f9aebf935048f77121d58cc380c2bf648a91458c..eaf85866c25a2bf117af75bdb1117deed3ba58c7 100644 |
--- a/src/builtins/s390/builtins-s390.cc |
+++ b/src/builtins/s390/builtins-s390.cc |
@@ -1896,6 +1896,16 @@ void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, |
__ LoadSmiLiteral(r2, Smi::FromInt(0)); |
__ EnterBuiltinFrame(cp, r3, r2); |
__ CallRuntime(Runtime::kThrowNotDateError); |
+ |
+ // It's far from obvious, but this final trailing instruction after the call |
+ // is required for StackFrame::LookupCode to work correctly. To illustrate |
+ // why: if call were the final instruction in the code object, then the pc |
+ // (== return address) would point beyond the code object when the stack is |
+ // traversed. When we then try to look up the code object through |
+ // StackFrame::LookupCode, we actually return the next code object that |
+ // happens to be on the same page in memory. |
+ // TODO(jgruber): A proper fix for this would be nice. |
+ __ nop(); |
} |
} |