Array shenanigans cause crash... or don't...

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
stan423321
Posts: 32
Joined: Tue Mar 25, 2014 2:35 pm

Array shenanigans cause crash... or don't...

Post by stan423321 »

Tested on 3.2-pre557 on Windows 10 Home 1703 15063.608. 64-bit build outright crashes (EDIT: without crash report dialog), 32-bit build doesn't appear to show any symptoms. The expected result is a VM crash in BOTH cases, which is what happens if array is not subject to shenanigans before access.

For testing enter MAP01 in Doom 2 on default difficulty, which can be easily done by spamming enter on the menu I think.

(Note: pk7 was blocked for some silly reason.)

Code: Select all

class X : ZombieMan replaces ZombieMan {
	States {
	Spawn:
		TNT1 A 0 NoDelay {
			Array<int> a;
			a.reserve(2000);
			a.push(3);
			a.push(4);
			a[-1] = 0;
		}
		goto Super::Spawn;
	}
}
Attachments
crashtest.pk3
(301 Bytes) Downloaded 32 times
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Array shenanigans cause crash... or don't...

Post by _mental_ »

I suppose negative indices should be rejected on compile time because on runtime only upper bound is checked. Actually they are rejected but only for static arrays.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Array shenanigans cause crash... or don't...

Post by _mental_ »

Fixed in 81ea9fb.
Post Reply

Return to “Closed Bugs [GZDoom]”