1
0
Fork 0
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:
Joshua Spence 2014-09-25 07:33:24 +10:00
parent 888ada2f38
commit 13492c8043
2 changed files with 4 additions and 1 deletions

View file

@ -426,7 +426,7 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
}
$span = $conditional
->getChildOfType(1, 'n_STATEMENT_LIST')
->getChildByIndex(1)
->getTokens();
$whitelist[$type][$symbol_name][] = range(

View file

@ -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';