Fix some stack overflow bugs
If re-entry triggers stack overflow, there is no FCall or FCallArray, so the code to find the pc in REQ_STACK_OVERFLOW would fail. If it managed to get through there, it would then try to DecRef the contents of an ActRec, sometimes causing it to DecRef a Func. In addition, if a "leaf" function resulted in re-entry we didn't necessarily check the stack. Differential Revision: D936843
Esse commit está contido em:
@@ -1655,7 +1655,8 @@ void VMExecutionContext::invokeFunc(TypedValue* retval,
|
||||
}
|
||||
Cell* savedSP = m_stack.top();
|
||||
|
||||
if (f->numParams() > kStackCheckReenterPadding - kNumActRecCells) {
|
||||
if (f->attrs() & AttrPhpLeafFn ||
|
||||
f->numParams() > kStackCheckReenterPadding - kNumActRecCells) {
|
||||
checkStack(m_stack, f);
|
||||
}
|
||||
|
||||
@@ -1797,7 +1798,8 @@ void VMExecutionContext::invokeFuncFew(TypedValue* retval,
|
||||
thiz->incRefCount();
|
||||
}
|
||||
Cell* savedSP = m_stack.top();
|
||||
if (argc > kStackCheckReenterPadding - kNumActRecCells) {
|
||||
if (f->attrs() & AttrPhpLeafFn ||
|
||||
argc > kStackCheckReenterPadding - kNumActRecCells) {
|
||||
checkStack(m_stack, f);
|
||||
}
|
||||
ActRec* ar = m_stack.allocA();
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário