[ZScript] Crash with multiple assignment expression

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Player701
 
 
Posts: 1636
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

[ZScript] Crash with multiple assignment expression

Post by Player701 »

From here. The following ZScript will cause GZDoom to crash with a very fatal error during compilation:

Code: Select all

class Test
{
    private int Test1()
    {
        return 0;
    }
    
    private void Test2()
    {
        int x;
        [x] = Test1();
    }
}
Note the square brackets in this line of code: [x] = Test1();. Removing them fixes the crash. The compiler should either ignore these brackets altogether, or treat them as a syntax error.

The crash happens here: TArray<ExpEmit,ExpEmit>::operator[](...) returned nullptr. The crash still happens even if the function being called actually returns multiple values.

Tested in GZDoom 4.8.0 and g4.9pre-13-g972e9cba0.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [ZScript] Crash with multiple assignment expression

Post by Graf Zahl »

It now emits an error
Post Reply

Return to “Closed Bugs [GZDoom]”