Index: src/ia32/code-stubs-ia32.cc |
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc |
index 9939c5213eb5e63bc5b8c0c8422c57712c1e802d..78824195df456e2787c6be0f12e76c77ec56e125 100644 |
--- a/src/ia32/code-stubs-ia32.cc |
+++ b/src/ia32/code-stubs-ia32.cc |
@@ -5406,8 +5406,12 @@ void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
Operand context_restore_operand(ebp, |
(2 + FCA::kContextSaveIndex) * kPointerSize); |
// Stores return the first js argument |
- int return_value_offset = |
- 2 + (is_store ? FCA::kArgsLength : FCA::kReturnValueOffset); |
+ int return_value_offset = 0; |
+ if (is_store) { |
+ return_value_offset = 2 + FCA::kArgsLength; |
+ } else { |
+ return_value_offset = 2 + FCA::kReturnValueOffset; |
+ } |
Operand return_value_operand(ebp, return_value_offset * kPointerSize); |
__ CallApiFunctionAndReturn(api_function_address, |
thunk_address, |