1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-22 21:40:54 +01:00

Fix a few edge cases for call-time pass-by-reference linting

Summary: Fix a few false positives.

Test Plan: Added test cases.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12134
This commit is contained in:
Joshua Spence 2015-03-23 23:21:18 +11:00
parent 1a2829d281
commit 8530cfcec1
2 changed files with 4 additions and 1 deletions

View file

@ -3107,7 +3107,7 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
$nodes = $root->selectDescendantsOfType('n_CALL_PARAMETER_LIST');
foreach ($nodes as $node) {
$parameters = $node->selectDescendantsOfType('n_VARIABLE_REFERENCE');
$parameters = $node->getChildrenOfType('n_VARIABLE_REFERENCE');
foreach ($parameters as $parameter) {
$this->raiseLintAtNode(

View file

@ -20,6 +20,9 @@ while (testfunc($var1, &$var2, $var3, &$var4) === false) {}
sprintf('0%o', 0777 & $p);
$foo(&$myvar);
array_walk(array(), function() use (&$x) {});
MyClass::myfunc(array(&$x, &$y));
~~~~~~~~~~
error:2:7 XHP19
error:9:8