diff --git a/src/Psalm/Internal/Codebase/TaintFlowGraph.php b/src/Psalm/Internal/Codebase/TaintFlowGraph.php index 01ed80faa..f6970f68b 100644 --- a/src/Psalm/Internal/Codebase/TaintFlowGraph.php +++ b/src/Psalm/Internal/Codebase/TaintFlowGraph.php @@ -222,7 +222,7 @@ class TaintFlowGraph extends DataFlowGraph /** * @param array $source_taints * @param array $sinks - * @return list + * @return array */ private function getChildNodes( DataFlowNode $generated_source, @@ -245,6 +245,8 @@ class TaintFlowGraph extends DataFlowGraph continue; } + $destination_node = $this->nodes[$to_id]; + $new_taints = \array_unique( \array_diff( \array_merge($source_taints, $added_taints), @@ -254,8 +256,6 @@ class TaintFlowGraph extends DataFlowGraph \sort($new_taints); - $destination_node = $this->nodes[$to_id]; - if (isset($visited_source_ids[$to_id][implode(',', $new_taints)])) { continue; } @@ -441,7 +441,8 @@ class TaintFlowGraph extends DataFlowGraph $new_destination->specialized_calls = $generated_source->specialized_calls; $new_destination->path_types = array_merge($generated_source->path_types, [$path_type]); - $new_sources[] = $new_destination; + $key = $to_id . ' ' . \json_encode($new_destination->specialized_calls); + $new_sources[$key] = $new_destination; } return $new_sources;