Skip to content

Commit dcf4eaa

Browse files
authored
[spec] Fix label shadowing (#1579)
1 parent 0031ea4 commit dcf4eaa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

document/core/text/instructions.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ The following grammar handles the corresponding update to the :ref:`identifier c
3434
\production{label} & \Tlabel_I &::=&
3535
v{:}\Tid &\Rightarrow& \{\ILABELS~v\} \compose I
3636
& (\iff v \notin I.\ILABELS) \\ &&|&
37+
v{:}\Tid &\Rightarrow& \{\ILABELS~v\} \compose (I \with \ILABELS[i] = \epsilon)
38+
& (\iff I.\ILABELS[i] = v) \\ &&|&
3739
\epsilon &\Rightarrow& \{\ILABELS~(\epsilon)\} \compose I \\
3840
\end{array}
3941
@@ -42,6 +44,9 @@ The following grammar handles the corresponding update to the :ref:`identifier c
4244
This effectively shifts all existing labels up by one,
4345
mirroring the fact that control instructions are indexed relatively not absolutely.
4446

47+
If a label with the same name already exists,
48+
then it is shadowed and the earlier label becomes inaccessible.
49+
4550

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

0 commit comments

Comments
 (0)