Pushing result of GetDefaultByType into array causes crash.

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

Pushing result of GetDefaultByType into array causes crash.

Postby Accensus » Wed Jun 10, 2020 2:27 pm

Tested with GZDoom 4.4.1 x64.

The title may be misleading due to character limit. The array is a class array.

Can be reproduced like this:
1. Get Bullet-Eye (that's where I discovered it; guaranteed to crash)
2. Open the mod and navigate to ZActors/Weapons/BEWeaponBase.zsc, Line 345. Where it says
Code: Select allExpand view
PickedWeapons.Push(CurrWeapon.GetClass());

change that to
Code: Select allExpand view
PickedWeapons.Push(CurrWeapon);

then start a new game, type "summon newweaponcapsule", and shoot it. It will immediately crash to desktop.

I could try to cook up a smaller example if deemed necessary.
User avatar
Accensus
Vector, locked in.
 
Joined: 11 Feb 2016
Location: Somalia
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: Pushing result of GetDefaultByType into array causes cra

Postby Graf Zahl » Fri Jun 12, 2020 9:01 am

The example is fine. This should have aborted at compile time for a type mismatch, but the compiler does not catch this particular one.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests