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

0 views
Skip to first unread message

Evan Typanski

unread,
Jul 15, 2026, 8:07:22 AM (11 days ago) Jul 15
to spicy-...@zeek.org
Branch: refs/heads/topic/etyp/fp-cycle-type
Home: https://github.com/zeek/spicy
Commit: dd4a251babca514617402abbcaa44c442cf080b6
https://github.com/zeek/spicy/commit/dd4a251babca514617402abbcaa44c442cf080b6
Author: Evan Typanski <evan.t...@corelight.com>
Date: 2026-07-15 (Wed, 15 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: 5bccbe811e8b4ef03f2f2751b422660b2e7da3d1
https://github.com/zeek/spicy/commit/5bccbe811e8b4ef03f2f2751b422660b2e7da3d1
Author: Evan Typanski <evan.t...@corelight.com>
Date: 2026-07-15 (Wed, 15 Jul 2026)

Changed paths:
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'

Since there's logic for QualifiedTypes to use the unification if it
exists, the operand list should use it, too. Before, it would always
use the unqualified check (with the occurs check), which meant that it
would report cycles for sequential types that were the same (ie two
parameters with the same struct type).


Compare: https://github.com/zeek/spicy/compare/59be0d17655f...5bccbe811e8b

To unsubscribe from these emails, change your notification settings at https://github.com/zeek/spicy/settings/notifications

Evan Typanski

unread,
Jul 15, 2026, 9:16:36 AM (11 days ago) Jul 15
to spicy-...@zeek.org
Branch: refs/heads/main
Commit: 0ac73c6164f031a1d6167e278c57d24992eef0f3
https://github.com/zeek/spicy/commit/0ac73c6164f031a1d6167e278c57d24992eef0f3
Author: Evan Typanski <evan.t...@corelight.com>
Date: 2026-07-15 (Wed, 15 Jul 2026)

Changed paths:
M CHANGES
M VERSION
M hilti/toolchain/src/compiler/optimizer/passes/dead-code-cfg.cc
M hilti/toolchain/src/compiler/type-unifier.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
A tests/spicy/types/function/cycle-params.spicy

Log Message:
-----------
Merge remote-tracking branch 'origin/topic/etyp/fp-cycle-type'

* origin/topic/etyp/fp-cycle-type:
Fix FP cycle in types with sequential, same types
Fix unresolved struct `self` in replacement


Compare: https://github.com/zeek/spicy/compare/89e8845573a2...0ac73c6164f0
Reply all
Reply to author
Forward
0 new messages