From: yangguo@chromium.org Date: Mon, 29 Aug 2011 13:29:55 +0000 (+0000) Subject: MIPS: Fix an invalid stack-check in the simulator. X-Git-Tag: upstream/4.7.83~18623 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2f1431aff171899d6a126ab14d689dbad794caa;p=platform%2Fupstream%2Fv8.git MIPS: Fix an invalid stack-check in the simulator. This fixes mjsunit regress-1132. BUG= TEST= Review URL: http://codereview.chromium.org/7781002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9059 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/mips/simulator-mips.cc b/src/mips/simulator-mips.cc index 30e12e7..3b38695 100644 --- a/src/mips/simulator-mips.cc +++ b/src/mips/simulator-mips.cc @@ -1409,20 +1409,11 @@ void Simulator::SoftwareInterrupt(Instruction* instr) { int32_t arg1 = get_register(a1); int32_t arg2 = get_register(a2); int32_t arg3 = get_register(a3); - int32_t arg4 = 0; - int32_t arg5 = 0; - // Need to check if sp is valid before assigning arg4, arg5. - // This is a fix for cctest test-api/CatchStackOverflow which causes - // the stack to overflow. For some reason arm doesn't need this - // stack check here. int32_t* stack_pointer = reinterpret_cast(get_register(sp)); - int32_t* stack = reinterpret_cast(stack_); - if (stack_pointer >= stack && stack_pointer < stack + stack_size_ - 5) { - // Args 4 and 5 are on the stack after the reserved space for args 0..3. - arg4 = stack_pointer[4]; - arg5 = stack_pointer[5]; - } + // Args 4 and 5 are on the stack after the reserved space for args 0..3. + int32_t arg4 = stack_pointer[4]; + int32_t arg5 = stack_pointer[5]; bool fp_call = (redirection->type() == ExternalReference::BUILTIN_FP_FP_CALL) ||