#18 crash with arrays

closed
nobody
None
5
2009-11-01
2007-03-17
p-null
No

Assignation of an array element not initialized to a var causes an inappropiate assignment value to that var. Resulting in basic-256 crash

Discussion

  • p-null

    p-null - 2007-03-17

    Program that produces crash

     
  • igb

    igb - 2007-04-07

    Logged In: YES
    user_id=1657486
    Originator: NO

    Hi,

    I did a fix and can send you a new Win executable if you wish.

    Best regards, Immo

     
  • p-null

    p-null - 2007-04-07

    Logged In: YES
    user_id=1745967
    Originator: YES

    I'm grateful if you do it

    p-null

     
  • Nobody/Anonymous

    basic-256 should warn you when trying to assign an array without first DIM'ing it.
    rem dim a(4)
    a = {1, 2, 3, 4}
    but instead it crashes. This would be very jarring to beginning programmers.

     
  • Jim Reneau

    Jim Reneau - 2009-11-01

    dim i$(4)
    i$[5] = "foo"

    now gives "ERROR on line 2: Array index out of bounds"

    Array bound checking was added in 0.9.2

     
  • Jim Reneau

    Jim Reneau - 2009-11-01
    • status: open --> closed
     

Log in to post a comment.