[zeek/spicy] 31317b: Fix unresolved struct `self` in replacement

0 views
Skip to first unread message

Evan Typanski

unread,
Jul 14, 2026, 3:22:52 PM (12 days ago) Jul 14
to spicy-...@zeek.org
Branch: refs/heads/topic/etyp/fp-cycle-type
Home: https://github.com/zeek/spicy
Commit: 31317b170c70273b342e290206b3c3f84508ed85
https://github.com/zeek/spicy/commit/31317b170c70273b342e290206b3c3f84508ed85
Author: Evan Typanski <evan.t...@corelight.com>
Date: 2026-07-14 (Tue, 14 Jul 2026)

Changed paths:
M hilti/toolchain/src/compiler/optimizer/passes/dead-code-cfg.cc
M tests/Baseline/hilti.cfg.dead-write-shadowed/output
M tests/Baseline/hilti.cfg.unreachable-return/output
M tests/Baseline/hilti.optimization.dataflow-unreachable/output
M tests/Baseline/hilti.optimization.unreachable-code/log
M tests/Baseline/spicy.optimization.default-parser-functions/log
M tests/Baseline/spicy.optimization.feature_requirements/log
M tests/Baseline/spicy.optimization.unused-functions/log
M tests/Baseline/spicy.optimization.unused-types/log
A tests/hilti/optimization/dead-code-cfg-resolve.hlt

Log Message:
-----------
Fix unresolved struct `self` in replacement

If a hilti struct got the local decl replaced by its RHS when removing
the dead store, the new RHS would not be resolved. This would mean that
`self` does not properly resolve anymore. Instead, make sure the RHS gets
resolved if anything is replaced.

This would trigger an internal error between optimizer passes, with an
AST dump of the offending node first:

[internal-error] declaration without canonical ID found: self


Commit: b7c1a8e8038bb4faef4e79ab568d6bd49f842ea0
https://github.com/zeek/spicy/commit/b7c1a8e8038bb4faef4e79ab568d6bd49f842ea0
Author: Evan Typanski <evan.t...@corelight.com>
Date: 2026-07-14 (Tue, 14 Jul 2026)

Changed paths:
M hilti/toolchain/include/compiler/type-unifier.h
M hilti/toolchain/src/compiler/type-unifier.cc
A tests/spicy/types/function/cycle-params.spicy

Log Message:
-----------
Fix FP cycle in types with sequential, same types

Fixes #2433

This would cause an error:

cycle detected in definition of type 'Test::S'

Note that this adds workarounds for 2 other cases: function types and
tuples. However, I could not get the issue to trigger for those, so the
test is only for the parameter list FP cycle.


Compare: https://github.com/zeek/spicy/compare/31317b170c70%5E...b7c1a8e8038b

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