Predict that constructors return KindOfNull
If we can't infer it, then predict it.
Esse commit está contido em:
@@ -3427,13 +3427,19 @@ bool EmitterVisitor::visitImpl(ConstructPtr node) {
|
||||
}
|
||||
|
||||
e.FCall(numParams);
|
||||
if (Option::WholeProgram) {
|
||||
bool inferred = false;
|
||||
if (Option::WholeProgram && Option::GenerateInferredTypes) {
|
||||
FunctionScopePtr fs = ne->getFuncScope();
|
||||
if (fs && !fs->getReturnType()) {
|
||||
m_evalStack.setKnownType(KindOfNull, false /* inferred */);
|
||||
m_evalStack.setKnownType(KindOfNull, false /* it's inferred */);
|
||||
m_evalStack.setNotRef();
|
||||
inferred = true;
|
||||
}
|
||||
}
|
||||
if (!inferred) {
|
||||
m_evalStack.setKnownType(KindOfNull, true /* it's predicted */);
|
||||
m_evalStack.setNotRef();
|
||||
}
|
||||
e.PopR();
|
||||
return true;
|
||||
}
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário