mirror of
https://github.com/irmen/prog8.git
synced 2025-12-19 20:17:17 +00:00
fix crash in long address-of
This commit is contained in:
@@ -1,33 +1,11 @@
|
||||
%import textio
|
||||
|
||||
main {
|
||||
|
||||
sub start() {
|
||||
ubyte[] array = ['h', 'e', 'l', 'l', 'o', 0]
|
||||
str name = "hello"
|
||||
|
||||
name[5] = '!' ; don't do this in real code...
|
||||
name[5] = 0
|
||||
name[6] = 99 ; out of bounds
|
||||
name[-1] = 99 ; ok
|
||||
name[-5] = 99 ; ok
|
||||
|
||||
cx16.r0L = name[5]
|
||||
cx16.r1L = name[6] ; out of bounds
|
||||
cx16.r1L = name[-1] ; ok
|
||||
cx16.r1L = name[-5] ; ok
|
||||
|
||||
array[5] = '!'
|
||||
array[5] = 0
|
||||
array[6] = 99 ; out of bounds
|
||||
array[-1] = 99 ; ok
|
||||
array[-5] = 99 ; ok
|
||||
array[-6] = 99 ; ok
|
||||
|
||||
cx16.r0L = array[5]
|
||||
cx16.r1L = array[6] ; out of bounds
|
||||
cx16.r1L = array[-1] ; ok
|
||||
cx16.r1L = array[-5] ; ok
|
||||
cx16.r1L = array[-6] ; ok
|
||||
const long buffer = 2000
|
||||
const long bufferl = 999999
|
||||
uword @shared addr = &buffer[2]
|
||||
long @shared addr2 = &bufferl[2]
|
||||
const long width = 100
|
||||
uword @shared addr3 = &buffer[width]
|
||||
long @shared addr4 = &bufferl[width]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user