Both of these commits (r639 and r640) were needed to get OpenSG so it 
could run with my newly added memory debugging code activated.  The 
problem was that when FCPtrs's are used throughout OpenSG there are some 
routines (cast_dynamic, getCPtr(), etc) that use the pointers in a way 
that offsets and computes things based on the internal pointer to the 
memory buffer for an fc.  When this pointer is NULL, the offsets and 
calculations are still performed.  IMHO this is a bug and all these 
cased should actually be corrected to recognize the fact that the ptr is 
NULL and act accordingly.  It just seems very risky to me to ever: a) 
compute a ptr offset with 0x0 as the base and b) to call any operation 
on a Null FCPtr.

What does everyone else think though?  Is this just something that is 
needed in the low-level code or should it be refactored to avoid this 
type of thing?

-Allen

-------- Original Message --------
Subject:        [Opensg-commits] r640 - trunk/Source/System/FieldContainer/Base
Date:   Wed, 28 Mar 2007 14:47:00 -0500 (CDT)
From:   [EMAIL PROTECTED]
Reply-To:       [email protected]
To:     [EMAIL PROTECTED]



Author: allenb
Date: Wed Mar 28 14:47:00 2007
New Revision: 640
Trac changeset: http://opensg.vrsource.org/trac/changeset/640
ViewVC: http://realityforge.vrsource.org/viewvc/opensg?view=rev&revision=640

Modified:
   trunk/Source/System/FieldContainer/Base/OSGFieldContainerPtr.cpp
Log:
Evidently the last commit (r639) didn't fix up all the problems.  It seems that 
there is still more code that likes to as for pointers to field containers from 
an 
fcptr that has a NULL value.  I took a different track fixing this one up.  Now 
I just have the getElemP code detect the case of a NULL _storeP and return NULL 
immediately instead of returning an offset from NULL.

I really really think the non-debugging code should be fixed up to do something 
similar because it seems like a *very* bad thing that we would ever return a 
pointer 
to a field container by adding an offset to 0x0 (NULL).


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensg-commits



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core

Reply via email to