Page MenuHomePhabricator

D12134.diff
No OneTemporary

D12134.diff

diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php
--- a/src/lint/linter/ArcanistXHPASTLinter.php
+++ b/src/lint/linter/ArcanistXHPASTLinter.php
@@ -3107,7 +3107,7 @@
$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(
diff --git a/src/lint/linter/__tests__/xhpast/call-time-pass-by-reference.lint-test b/src/lint/linter/__tests__/xhpast/call-time-pass-by-reference.lint-test
--- a/src/lint/linter/__tests__/xhpast/call-time-pass-by-reference.lint-test
+++ b/src/lint/linter/__tests__/xhpast/call-time-pass-by-reference.lint-test
@@ -20,6 +20,9 @@
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

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 9:59 AM (17 h, 56 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6778166
Default Alt Text
D12134.diff (1 KB)

Event Timeline