Skip to content

Commit

Permalink
Fixed bug in loop merging
Browse files Browse the repository at this point in the history
  • Loading branch information
terminationshock committed Feb 19, 2023
1 parent 03d8f86 commit 8d2a8eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/assembly.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func Assembly(code []*Command, file string, stackSize int, verbose bool) (string
if n < 0 {
return "", errors.New(fmt.Sprintf("No matching loop begin at %s:%d:%d", file, c.Row, c.Col))
}
program = strings.Replace(program, fmt.Sprintf(".break%d", loops[n].Number), mergedBreak, -1)
program = strings.Replace(program, fmt.Sprintf(".break%d\n", loops[n].Number), mergedBreak + "\n", -1)
}
loops = loops[:n]
inst++
Expand Down

0 comments on commit 8d2a8eb

Please sign in to comment.