[since old times] CheckLocalView called on NULL pointer

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
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

[since old times] CheckLocalView called on NULL pointer

Post by Edward-san »

While I was investigating a crash in a zandronum ticket, I noticed that repeating the 'dying npc' process in zdoom, no crash happened in src/g_strife/a_strifeitems.cpp:

Code: Select all

if (dropper->target->CheckLocalView (consoleplayer))
even though dropper->target is NULL. Inside CheckLocalView there's no direct access to any member variable, but it's still undefined behavior according to the C++ Standard. What do you think? Is it correct that the npc has no target when it dies?

Steps for zdoom:
- (developer) put a breakpoint at the line above;
- load zdoom with: `zdoom -iwad doom2.wad -file npccrash_01.wad -warp 01 -skill 4` ;
- press '+attack' once against one marine and wait that it dies because of the wounds.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [since old times] CheckLocalView called on NULL pointer

Post by Graf Zahl »

As you say, it's undefined so better add a check to both places where this happens.
Post Reply

Return to “Closed Bugs [GZDoom]”