What does "The interpreter has gone wrong" mean?
Sometimes Matrix Brandy reports "The interpreter has gone wrong", more often than not "The interpreter has gone wrong at line 61". What does this really mean? What does 'line 61' refer to?
0
Comments
-
This will be a reference to a line in the source code, picked up by a GCC macro. The error should also identify which source component. The error won't actually be in that line, but that's the line of the statement reporting the error..!
What were you doing to trip that error?0 -
What were you doing to trip that error?
0 -
A typical example of this is if execution has fallen off the end of all expected valued in a C switch() statement, which wouldn't be expected to happen.0
-
A typical example of this is if execution has fallen off the end of all expected valued in a C switch() statement, which wouldn't be expected to happen.
The message "the interpreter has gone wrong" implies to me that the interpreter is at fault, but on the occasions when I have received that error it will be my BASIC program which was 'at fault' for containing code not compliant with the language syntax.
I suppose the fundamental reason for me not being able to grasp this is that none of my interpreters, right back to the Z80 version, have had anything similar. A mistake in the BASIC program is either detected (in which case it reports Syntax Error or similar) or it isn't detected (in which case, by definition, nothing is reported).
I can't think of anywhere in my interpreters where this 'mistake of the third kind' could happen.
0 -
Another way to think about it is a "caught" crash in the interpreter. If the BASIC program is incorrect a proper error message should be raised.0
-
Another way to think about it is a "caught" crash in the interpreter. If the BASIC program is incorrect a proper error message should be raised.
In my interpreters I don't attempt to 'catch' any fatal errors, because Raymond Chen says it's a very bad thing to do - it's just risking later instability.
Anyway, there is no mechanism in SDL2 to do that in a cross-platform fashion (I bet the code you use doesn't work in Android, iOS and Emscripten - if it does I'd be interested to see it).
So the upshot of all this is that a simple syntax error in the BASIC code can trigger a 'fatal' (albeit caught) error? That's surprising, isn't it?
0 -
It shouldn't do, from what I have figured out it's Dave Daniels' attempt to go "Oops, that shouldn't have happened..." and try to give some indication where in the code it happened as a kind of a debugging statement.0