ID:2016783
 
Resolved
The "invalid variable" message was sometimes suppressed during compilation when it shouldn't have been, allowing worlds to compile that should have failed.
BYOND Version:509
Operating System:Linux
Web Browser:Chrome 47.0.2526.106
Applies to:Dream Maker
Status: Resolved (510.1320)

This issue has been resolved.
Descriptive Problem Summary:
Code that uses a variable before it is declared compiles, but does not run, crashing Dream Daemon.

Numbered Steps to Reproduce Problem:
Write code that uses a variable before it is declared
Compile the code, and see a warning but no errors
Run the code in Dream Daemon and watch it crash

Code Snippet (if applicable) to Reproduce Problem:
/world/New()
e = 1
var/e

or
/world/New()
e = 1
try
throw(1)
catch(var/e)


Expected Results:
Code that attempted to use a variable before its declaration would not compile

Actual Results:
Code that attempts to use a variable before its declaration compiles, but crashes Dream Daemon if the code executes.

Does the problem occur:
Every time? Or how often? Every time
In other games? N/A
In other user accounts? Unknown
On other computers? Unknown

When does the problem NOT occur? Unknown

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Behaving as described in at least 499.1204, 508.1299, 509.1318 and 509.1319.

Workarounds: Declare vars before you use them?

The solution: don't be an idiot.
In response to GreatPirateEra
GreatPirateEra wrote:
The solution: don't be an idiot.

You're the idiot. All it takes to infect a computer is for somebody to exploit one little overflow error.
This turns out to be a fairly nasty compiler error. The issue is that the var is waiting for more info, but apparently it never gets that info before the proc code gets compiled. Oddly, the "invalid variable" error that's supposed to happen doesn't. The causes are too difficult to suss out, so I put in a stopgap to force the error.

The fix for this will go live in 510.
Lummox JR resolved issue with message:
The "invalid variable" message was sometimes suppressed during compilation when it shouldn't have been, allowing worlds to compile that should have failed.