LoginLogin
Might make SBS readonly: thread

Labels and compilation error bug thing

Root / SmileBASIC Bug Reports / [.]

12Me21Created:
Step 1: run this in slot 0
@A
PRINT "Hi"
Step 2: run this in slot 0
@A@'something that contains the previous label and causes a syntax error
Step 3: run this in direct mode:
GOTO @A
It will print "Hi". Apparently you can use this to crash SB somehow.

For more explicit instructions: Step 1: Run this in slot 0:
@A B$="Hi":PRINT B$
It runs fine. Step 2: Run this in slot 0:
@A@B$="Hi":PRINT B$
It generates a Syntax Error. Step 3: Run this in direct mode:
GOTO @A
The 'direct mode' cursor stops blinking for a couple of seconds. The system shows "An error has occurred, forcing the software to close. The system will now restart. (Unsaved data may be lost.)". Not every syntax-error-causing code in step 2 will cause this. New 3DS, SmileBasic 3.3.2.

maybe it's because the second program creates another variable B$ and the first one tries to access it... or something.

I tried it myself and this is the result:
My first conclusion which seems incorrect(? / PRINT) B$ doesn't matter here. This can be omitted. I think SB gets confused rather if @B$ is a label or a variable and (, what SB always does,) crashes. (It doesn't matter if B$ got something in the 1st place. I tried it after SB crashed and the results were the same.)
Old 2DS, SmileBASIC EUR 3.5.2 It turns out the "$" sign is placed in a way where SB gets confused whether "@$" is a label or a string variable. Leaving @ and/or $ alone without alphanumerical symbols, will end up crashing SB, once you run the program and come to that point in direct mode like: >=Input [Blank]=Output
 OK
>RUN 'or pressing START/SELECT
 Syntax Error in 0:1
>GOTO @A