bcc icon indicating copy to clipboard operation
bcc copied to clipboard

Array out of bounds allowed?

Open DruggedBunny opened this issue 9 months ago • 6 comments

Hi all,

While playing with Mark's LibSGD, I realised by chance that I was accessing an array incorrectly, and narrowed it down to this:

SuperStrict

Local sound:Int [7]	' Booms

For Local num:Int = 1 To 10
	sound [num] = num
	Print sound [num]
Next

Print sound [10]

BlitzMax vanilla gives the expected:

"Unhandled Exception:Attempt to index array element beyond array length"

In NG, this compiles and prints output for each index!

  • Operating System: Windows 7, 64-bit
  • Output of bcc -v: BlitzMax Release Version 1.50

DruggedBunny avatar May 25 '24 03:05 DruggedBunny