[Fixed] [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.

[ZScript] Crash with multiple assignment expression

Postby Player701 » Wed Jun 15, 2022 1:15 pm

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

Code: Select allExpand view
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
Joined: 13 May 2009
Location: Russia
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

Re: [ZScript] Crash with multiple assignment expression

Postby Graf Zahl » Thu Jun 16, 2022 2:47 am

It now emits an error
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Joined: 19 Jul 2003
Location: Germany

Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest