Subscripts can crash SB
Root / SmileBASIC Bug Reports / [.]
MZ952Created:
It crashes SB while the code is being parsed (try running it with STOP or END before)
I'm guessing that it's trying to pre-evaluate the expression (which I thought SB didn't to for strings... maybe it's only with [] or something)
Interestingly, using 1638 [0]s with a variable will cause an out of memory error, while anything less works fine.
type |less 1638 more "A" |works crash error A$ |works error error "A"*1|works error errorso yeah, looks like only "string"[index] is precomputed, which is kind of strange, but makes sense because it would reduce the size of the code, unlike something like "string"*2 which would use MORE code memory. EDIT: I did some testing, and it doesn't look like "A"[0] is precomputed, because it's slower than "A" by itself.