Skip to content

Commit 001848b

Browse files
committed
Explain rerun
1 parent bddca4d commit 001848b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

data/transactions/logic/assembler.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1938,7 +1938,15 @@ type disassembleState struct {
19381938
numericTargets bool
19391939
labelCount int
19401940
pendingLabels map[int]string
1941-
rerun bool
1941+
1942+
// If we find a (back) jump to a label we did not generate
1943+
// (because we didn't know about it yet), rerun is set to
1944+
// true, and we make a second attempt to assemble once the
1945+
// first attempt is done. The second attempt retains all the
1946+
// labels found in the first pass. In effect, the first
1947+
// attempt to assemble becomes a first-pass in a two-pass
1948+
// assembly process that simply collects jump target labels.
1949+
rerun bool
19421950

19431951
nextpc int
19441952
err error

0 commit comments

Comments
 (0)