[zeek/spicy] d0cca0: Fix FPs in `FunctionParamVisitor` when parameters ...

0 views
Skip to first unread message

Benjamin Bannier

unread,
Oct 21, 2025, 3:11:51 PM (17 hours ago) Oct 21
to spicy-...@zeek.org
Branch: refs/heads/topic/bbannier/issue-2184
Home: https://github.com/zeek/spicy
Commit: d0cca0378931b589df521379545a4fff154a1e57
https://github.com/zeek/spicy/commit/d0cca0378931b589df521379545a4fff154a1e57
Author: Benjamin Bannier <benjamin...@corelight.com>
Date: 2025-10-21 (Tue, 21 Oct 2025)

Changed paths:
M hilti/toolchain/src/compiler/optimizer.cc
M tests/Baseline/spicy.optimization.feature_requirements/log
M tests/Baseline/spicy.optimization.unused-functions/log
M tests/Baseline/spicy.optimization.unused-types/log
M tests/Baseline/spicy.types.unit.canonical-ids/output
M tests/hilti/output/optimization/remove-params.hlt

Log Message:
-----------
Fix FPs in `FunctionParamVisitor` when parameters are shadowed.

The tracking of parameter use in `FunctionParamVisitor` relied on IDs to
correlate seen `expression::Name`s and parameter declarations. This
broke down when parameters where shadowed, e.g., we often end up
shadowing the `__cur` parameter.

With this patch we additionally check that the resolved `Declaration`
for an `Name` matches the parameter to take this into account.

Closes #2184.



To unsubscribe from these emails, change your notification settings at https://github.com/zeek/spicy/settings/notifications
Reply all
Reply to author
Forward
0 new messages