Code: Select all
*mem = AllocateMemory(4096) ; allocate 4096
For i = 1 To 6000 ; using 6000 instead 4096
PokeB(*mem+i,$FF)
Next
Code: Select all
*mem = AllocateMemory(4096) ; allocate 4096
For i = 1 To 6000 ; using 6000 instead 4096
PokeB(*mem+i,$FF)
Next
Code: Select all
buffersize=4096
*buffer=AllocateMemory(buffersize)
if *buffer=0 : Goto error : endif ;always check if the memory was allocated or not.
For i = 1 To (buffersize-1) ;-1 if bytes, -2 if word, -4 if long
PokeB(*mem+i,$FF)
Next
yes i know its not a bug of pure! its a bug by the programmer! i only thought it would/could be nice if the debugger check this instead crashing...PB wrote:> Not a bug
Agreed. In the example given it's obvious that you're poking outside of what
you allocated, but in a real-world app the debugger has no business deciding
what you want to do with Pokes.