Commits

Ross Light  committed 062dfb4

User stacks are only present in version 6, not later versions

  • Participants
  • Parent commits 738e4e6

Comments (0)

Files changed (2)

File north/exec.go

 		m.currStackFrame().Push(ops[0])
 	case 0x9:
 		// pull
-		if m.Version() < 6 {
-			m.setVariable(uint8(ops[0]), m.currStackFrame().Pop())
-		} else {
+		if m.Version() == 6 {
 			return errors.New("multiple stacks not supported yet")
 		}
+		m.setVariable(uint8(ops[0]), m.currStackFrame().Pop())
 	case 0xa:
 		// split_window
 		// TODO

File north/instruction.go

 		_, ok := longInstruction{opcode: n}.StoreVariable()
 		return vi.storeVariable, ok
 	}
-	return vi.storeVariable, n == 0x00 || (vi.version >= 5 && n == 0x04) || n == 0x07 || (vi.version >= 6 && n == 0x09) || n == 0x0c || (n >= 0x16 && n <= 0x18)
+	return vi.storeVariable, n == 0x00 || (vi.version >= 5 && n == 0x04) || n == 0x07 || (vi.version == 6 && n == 0x09) || n == 0x0c || (n >= 0x16 && n <= 0x18)
 }
 
 func (vi variableInstruction) BranchInfo() (branchInfo, bool) {