Closed Bug 14653 Opened 26 years ago Closed 25 years ago

small pointer problem in db/mork/src/morkDeque.cpp?

Categories

(Core Graveyard :: Tracking, defect, P3)

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: colin, Assigned: Bienvenu)

Details

This belongs to Mork, but there's no component for Mork (or DB) yet! In db/mork/src/morkDeque.cpp, there is the following code: void morkNext::ZapOldNext(morkEnv* ev, nsIMdbHeap* ioHeap) { if ( &ioHeap ) { if ( this ) ioHeap->Free(ev->AsMdbEnv(), this); } else ev->NilPointerError(); } The OpenVMS C++ compiler complains that the last statement (the call to NilPointerError) is unreachable. Since ioHeap is a pointer, I guess that &ioHeap is the address of the pointer. And since this is always non-zero, even for a null pointer, the if test doesn't make sense??? Anyway, thought you might want to look at this and maybe give it some consideration. Colin.
Same goes for morkLink::ZapOldLink. That makes two occurences of this "problem" in morkDequeue.cpp.
Assignee: chofmann → davidmc
-> davidmc
Okay, I'll fix it; originally the code would have passed nsIMdbHeap as a reference, so that &ioHeap would yield actual the pointer. All I can say is I wrote the code in a hurry one day when making change lists for incrementally writing tables. Thanks for reporting this.
Target Milestone: M14
QA Contact: leger → davidmc
these are mine now, I guess.
Assignee: davidmc → bienvenu
accepting
Status: NEW → ASSIGNED
m20
Target Milestone: M14 → M20
fix checked in - if ioheap were null, I think we would have crashed, so this was useful to fix.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
QA Contact: davidmc → stephend
1.6 bienvenu%netscape.com Jun 22 2000 fix build warning 14653
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.