mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-03-21 08:40:07 +01:00
Fix a fatal error in ArcanistXHPASTLinter
Summary: I had assumed that we would always be interested in `n_STATEMENT_LIST`, which is fine for `if (...) { some_statements(); }` but not for `if (...) one_statement();`. Test Plan: Added a test case. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D10551
This commit is contained in:
parent
888ada2f38
commit
13492c8043
2 changed files with 4 additions and 1 deletions
|
@ -426,7 +426,7 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
|
||||||
}
|
}
|
||||||
|
|
||||||
$span = $conditional
|
$span = $conditional
|
||||||
->getChildOfType(1, 'n_STATEMENT_LIST')
|
->getChildByIndex(1)
|
||||||
->getTokens();
|
->getTokens();
|
||||||
|
|
||||||
$whitelist[$type][$symbol_name][] = range(
|
$whitelist[$type][$symbol_name][] = range(
|
||||||
|
|
|
@ -12,6 +12,9 @@ if (class_exists('CURLFile')) {
|
||||||
new DateTimeImmutable();
|
new DateTimeImmutable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (function_exists('json_last_error_msg'))
|
||||||
|
json_last_error_msg();
|
||||||
|
|
||||||
// These shouldn't fatal.
|
// These shouldn't fatal.
|
||||||
if (SomeClass::someStaticMethod($param)) {}
|
if (SomeClass::someStaticMethod($param)) {}
|
||||||
$var = 'some_func';
|
$var = 'some_func';
|
||||||
|
|
Loading…
Add table
Reference in a new issue