ID:1568355
 
BYOND Version:506
Operating System:Windows 8 64-bit
Web Browser:Chrome 34.0.1847.131
Applies to:Dream Maker
Status: Verified

A member of our crack team of bug testers has verified that this issue is reproducible, and has handed it off to the development team for investigation.
Descriptive Problem Summary:
Compile the code and Dream Maker crashes.

I believe the compiler doesn't know what to do with the code.

Numbered Steps to Reproduce Problem:
Paste the code. Compile the code.

Code Snippet (if applicable) to Reproduce Problem:
var/list/docs=list()

mob/verb/Test()
for({var/mob/P in world;var/a in docs})
world<<a


Expected Results:
It to compile and when I run, I see everything in docs.
Actual Results:
Dream maker Crashes.
Does the problem occur: ALWAYS
Every time? Or how often?
In other games?
In other user accounts?
On other computers?

When does the problem NOT occur?
If I don't make the for() statement have multiple instances.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.) I believe it always occured.

Workarounds:

Just use the original for() method without doing multiple instances.


Please Note that I do know that it is pointless doing what I am doing, I'm just trying to find potential bugs and shortcuts in BYOND and came upon this.

I think it shouldn't try to compile and instead it read as an error rather than crash but that's just me.
...I don't think I've ever seen this particular style of syntax used in any language, and I know over 20 languages. Why would you expect this to have worked in the first place?
It was all a theoretical sense.

Lets just say if you wish to increment two values or have two things run at the same time in a theoretical sense without having to define two for() statements.

Example: (Just Theoretical) - Works.

mob/verb/Test()
for({var/x=0;var/y=0};x<=10;{x++;y++})
src<<"[x] x [y] = [x*y]"
Your example doesn't clarify at all, because you are using two variables where two aren't needed.

for(var/x=0;x<=10;x++)
src << "[x]^2 = [x**2]"


Why avoid using two for loops? The majority of the CPU hit is going to come from what you put in the body of the loop anyway, not from the actual loops themselves.
This probably should return a compiler error.

As it is, if this is what you're doing with the compiler, you're going find a lot of these bugs, because the compiler does not secure all the cases the VM can't handle, not by a long shot.

I'm not quite sure of the value of such a body of work, or the consequent bug reports, I have to admit.
This is definitely a low-priority report, inasmuch as it's playing with extremely bogus syntax, but I agree at least that the crash is a bug. I'm in the middle of another thing now though and not in any rush to fix it.
Stephen001 changed status to 'Verified'