Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spec] Fix label shadowing #1579

Merged
merged 2 commits into from
Jan 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions document/core/text/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ The following grammar handles the corresponding update to the :ref:`identifier c
\production{label} & \Tlabel_I &::=&
v{:}\Tid &\Rightarrow& \{\ILABELS~v\} \compose I
& (\iff v \notin I.\ILABELS) \\ &&|&
v{:}\Tid &\Rightarrow& \{\ILABELS~v\} \compose (I \with \ILABELS[i] = \epsilon)
& (\iff I.\ILABELS[i] = v) \\ &&|&
\epsilon &\Rightarrow& \{\ILABELS~(\epsilon)\} \compose I \\
\end{array}

Expand All @@ -42,6 +44,9 @@ The following grammar handles the corresponding update to the :ref:`identifier c
This effectively shifts all existing labels up by one,
mirroring the fact that control instructions are indexed relatively not absolutely.

If a label with the same name already exists,
then it is shadowed and the earlier label becomes inaccessible.


.. index:: control instructions, structured control, label, block, branch, result type, label index, function index, type index, vector, polymorphism
pair: text format; instruction
Expand Down