fix bug in variable addressing if they weren't immediately written to

This commit is contained in:
2021-02-25 21:13:03 -05:00
parent e428c883db
commit 0784661e7c
2 changed files with 2 additions and 2 deletions

2
mem.go
View File

@@ -28,7 +28,7 @@ func (m *Memory) Write(addr int, values []int) error {
m.intern[addr+i] = values[i]
}
// we've written past our marker, note that
if m.nextFree < addr+len(values) {
if m.nextFree <= addr+len(values) {
m.nextFree = addr + len(values)
}
return nil