Fix crash in linting

Redeclared functions in non-whole-program analyze mode caused
an assertion failure.

Test Plan:
  % cat bug.php
  <?php
  if (isset($g)) {
    function f($x, $y) {}
  } else {
    function f($x) {}
  }
  f($x);
  % hphp -vWholeProgram=false -t analyze bug.php
Esse commit está contido em:
mwilliams
2013-04-15 12:38:10 -07:00
commit de Sara Golemon
commit 62315ccb15
@@ -1128,7 +1128,7 @@ TypePtr SimpleFunctionCall::inferAndCheck(AnalysisResultPtr ar, TypePtr type,
setAttribute(VariableTable::NeedGlobalPointer);
}
if (m_params) {
if (func && func->isRedeclaring()) {
if (Option::WholeProgram && func && func->isRedeclaring()) {
FunctionScope::FunctionInfoPtr info =
FunctionScope::GetFunctionInfo(m_name);
always_assert(info);