Skip to content

format: make invoke.target optional for internal calls#213

Open
gnidan wants to merge 2 commits intotransform-contextfrom
architect-invoke-target-optional
Open

format: make invoke.target optional for internal calls#213
gnidan wants to merge 2 commits intotransform-contextfrom
architect-invoke-target-optional

Conversation

@gnidan
Copy link
Copy Markdown
Member

@gnidan gnidan commented Apr 16, 2026

Internal calls via JUMP normally carry a code pointer to the
callee's entry point. When the compiler inlines a function,
the JUMP is elided — there is no physical call instruction
and no code target to point at. The callee identity
(identifier, declaration, type) remains meaningful, but
the target pointer does not.

Same pattern as #211 (making return.data optional). Unblocks
inlining: bugc can emit invoke contexts on inlined first
instructions without fabricating a target pointer.

  • Schema: drop target from InternalCall.required, expand
    description, add worked example for inlined case
  • TS types: mark target optional; guard relaxed accordingly
  • Spec page: document optionality and point at a separate
    transform annotation (via gather) for the inlining
  • bugc: guard target access in patchInvokeInContext; tests
    assert target defined before dereferencing

Internal calls via JUMP normally carry a code pointer to the
callee's entry point. When the compiler inlines a function,
the JUMP is elided — there is no physical call instruction
and no code target to point at. The callee identity
(identifier, declaration, type) remains meaningful, but the
target pointer does not.

Same pattern as #211 (making return.data optional). Unblocks
inlining: bugc can emit invoke contexts on inlined first
instructions without fabricating a target pointer.

- Schema: drop target from InternalCall.required, expand
  description, add worked example for inlined case
- TS types: mark target optional; guard relaxed
- Spec page: document optionality and point at transform +
  gather for inlining annotation
- bugc: guard target access in patchInvokeInContext; tests
  assert target defined before dereferencing
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://ethdebug.github.io/format/pr-preview/pr-213/

Built to branch gh-pages at 2026-04-16 09:14 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@gnidan gnidan changed the base branch from main to transform-context April 16, 2026 08:06
Pair with #212's flat-form guidance: when an inlined body's
first instruction carries both an invoke and a transform,
those belong as sibling keys on a single context — gather
isn't needed because `invoke` and `transform` don't collide.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant