[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.
User avatar
Player701
 
 
Posts: 1382
Joined: Wed May 13, 2009 3:15 am
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support
Location: Russia

[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: 47962
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

Return to “Closed Bugs”