Commit c2498fe8 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[unwinder] Remove final FP bounds check which is invalid on Windows

Bug: v8:9092
Change-Id: I1839651c0a47dbbefa93c7441597c98653132ff8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1554692
Auto-Submit: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60748}
parent 69e90801
......@@ -80,8 +80,11 @@ bool Unwinder::TryUnwindV8Frames(const UnwindState& unwind_state,
if (!AddressIsInStack(final_sp, stack_base, stack_top)) return false;
register_state->sp = final_sp;
// We don't check that the final FP value is within the stack bounds because
// this is just the rbp value that JSEntryStub pushed. On platforms like
// Win64 this is not used as a dedicated FP register, and could contain
// anything.
void* final_fp = GetCallerFPFromFP(current_fp);
if (!AddressIsInStack(final_fp, stack_base, stack_top)) return false;
register_state->fp = final_fp;
register_state->pc = next_pc;
......
......@@ -423,11 +423,13 @@ TEST(Unwind_StackBounds_WithUnwinding) {
stack_base);
CHECK(!unwound);
// Change the return address so that it is not in range.
// Change the return address so that it is not in range. We will not range
// check the stack[9] FP value because we have finished unwinding and the
// contents of rbp does not necessarily have to be the FP in this case.
stack[10] = 202;
unwound = v8::Unwinder::TryUnwindV8Frames(unwind_state, &register_state,
stack_base);
CHECK(!unwound);
CHECK(unwound);
}
TEST(PCIsInV8_BadState_Fail) {
......@@ -482,8 +484,8 @@ TEST(PCIsInV8_InCodeOrEmbeddedRange) {
embedded_range_length);
}
// PCIsInV8 doesn't check if the PC is in JSEntrydirectly. It's assumed that the
// CodeRange or EmbeddedCodeRange contain JSEntry.
// PCIsInV8 doesn't check if the PC is in JSEntry directly. It's assumed that
// the CodeRange or EmbeddedCodeRange contain JSEntry.
TEST(PCIsInV8_InJSEntryRange) {
LocalContext env;
v8::Isolate* isolate = env->GetIsolate();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment