mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-03-20 16:20:08 +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
|
||||
->getChildOfType(1, 'n_STATEMENT_LIST')
|
||||
->getChildByIndex(1)
|
||||
->getTokens();
|
||||
|
||||
$whitelist[$type][$symbol_name][] = range(
|
||||
|
|
|
@ -12,6 +12,9 @@ if (class_exists('CURLFile')) {
|
|||
new DateTimeImmutable();
|
||||
}
|
||||
|
||||
if (function_exists('json_last_error_msg'))
|
||||
json_last_error_msg();
|
||||
|
||||
// These shouldn't fatal.
|
||||
if (SomeClass::someStaticMethod($param)) {}
|
||||
$var = 'some_func';
|
||||
|
|
Loading…
Add table
Reference in a new issue