Skip to content

Commit

Permalink
Check for stack overflow in GeneratorInnerFunction.
Browse files Browse the repository at this point in the history
Summary:
Other users of ScopedNativeCallFrame check `frame.overflowed()`,
and we should do that in generators as well.

Reviewed By: dulinriley

Differential Revision: D17407933

fbshipit-source-id: fe785ddff356ed251e9ffddc7a7b1a2a8cdc2bed
  • Loading branch information
avp authored and facebook-github-bot committed Sep 18, 2019
1 parent 3995473 commit 4e33221
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/VM/Callable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,8 @@ CallResult<HermesValue> GeneratorInnerFunction::callInnerFunction(
selfHandle.getHermesValue(),
newTarget,
ctx->at(0)};
if (LLVM_UNLIKELY(frame.overflowed()))
return runtime->raiseStackOverflow(Runtime::StackOverflowKind::NativeStack);
for (ArrayStorage::size_type i = 0, e = argCount; i < e; ++i) {
frame->getArgRef(i) = ctx->at(i + 1);
}
Expand Down

0 comments on commit 4e33221

Please sign in to comment.