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:
mwilliams
2013-04-17 09:50:06 -07:00
commit de Sara Golemon
commit d39bf0bcfe
2 arquivos alterados com 2 adições e 6 exclusões
@@ -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);