Skip to content

Commit

Permalink
Bug 1373663 - Establish non-oom precondition for patching. r=luke
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : af62b9d5264a6ea5458818167eb3c4ef4f8edf4a
  • Loading branch information
Lars T Hansen committed Jun 21, 2017
1 parent 3085458 commit e111b5c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/src/wasm/WasmBaselineCompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2341,6 +2341,10 @@ class BaseCompiler
// frame size. Flush the constant pool in case it needs to be patched.
MOZ_ASSERT(maxFramePushed_ >= localSize_);
masm.flush();

// Precondition for patching.
if (masm.oom())
return false;
masm.patchAdd32ToPtr(stackAddOffset_, Imm32(-int32_t(maxFramePushed_ - localSize_)));

// Since we just overflowed the stack, to be on the safe side, pop the
Expand Down

0 comments on commit e111b5c

Please sign in to comment.