Skip to content

Commit b513b32

Browse files
committed
Tmp
1 parent bda7a57 commit b513b32

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/Psalm/Internal/Codebase/TaintFlowGraph.php

+6
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ public function connectSinksAndSources(Progress $progress): void
310310
if ($specialized_calls) {
311311
// If processing descendants of a specialized call, accept only descendants.
312312
foreach ($this->specializations[$source->id] as $specialization => $specialized_id) {
313+
if (!isset($this->forward_edges[$specialized_id])) {
314+
continue;
315+
}
313316
if (!isset($specialized_calls[$specialization])) {
314317
continue;
315318
}
@@ -342,6 +345,9 @@ public function connectSinksAndSources(Progress $progress): void
342345
} else {
343346
// If not processing descendants, accept all specializations.
344347
foreach ($this->specializations[$source->id] as $specialization => $specialized_id) {
348+
if (!isset($this->forward_edges[$specialized_id])) {
349+
continue;
350+
}
345351
$new_source = new DataFlowNode(
346352
$specialized_id,
347353
$source->id,

src/Psalm/Internal/DataFlow/DataFlowNode.php

+5-10
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,12 @@ public static function getForAssignment(
9292
CodeLocation $assignment_location,
9393
?string $specialization_key = null,
9494
): self {
95-
if ($specialization_key === null) {
96-
$specialization_key = $assignment_location->file_name
97-
. ':' . $assignment_location->raw_file_start
98-
. '-' . $assignment_location->raw_file_end;
99-
} else {
100-
$specialization_key .= '-' . $assignment_location->file_name
101-
. ':' . $assignment_location->raw_file_start
102-
. '-' . $assignment_location->raw_file_end;
103-
}
95+
$label = $var_id;
96+
$var_id .= ':' . $assignment_location->file_name
97+
. ':' . $assignment_location->raw_file_start
98+
. '-' . $assignment_location->raw_file_end;
10499

105-
return self::make($var_id, $var_id, $assignment_location, $specialization_key);
100+
return self::make($var_id, $label, $assignment_location, $specialization_key);
106101
}
107102

108103
public static function getForMethodReturn(

0 commit comments

Comments
 (0)