Method names should not be coerced to string
Zend fatals if the type is not string, where hphp would coerce to string. In RepoAuthoritative mode, this meant that scalar expressions would be converted to strings at bytecode emission time, bypassing the fatal (or, in most cases, resulting in a different fatal).
Esse commit está contido em:
@@ -103,11 +103,7 @@ TypePtr DynamicFunctionCall::inferTypes(AnalysisResultPtr ar, TypePtr type,
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_class && m_className.empty()) {
|
||||
m_nameExp->inferAndCheck(ar, Type::Variant, false);
|
||||
} else {
|
||||
m_nameExp->inferAndCheck(ar, Type::String, false);
|
||||
}
|
||||
m_nameExp->inferAndCheck(ar, Type::Some, false);
|
||||
|
||||
if (m_params) {
|
||||
for (int i = 0; i < m_params->getCount(); i++) {
|
||||
|
||||
@@ -185,7 +185,7 @@ TypePtr ObjectMethodExpression::inferAndCheck(AnalysisResultPtr ar,
|
||||
m_bindClass = true;
|
||||
|
||||
if (m_name.empty()) {
|
||||
m_nameExp->inferAndCheck(ar, Type::String, false);
|
||||
m_nameExp->inferAndCheck(ar, Type::Some, false);
|
||||
setInvokeParams(ar);
|
||||
// we have to use a variant to hold dynamic value
|
||||
return checkTypesImpl(ar, type, Type::Variant, coerce);
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário