http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n843.pdf

On page 90, look at 6.5.13, bullet 4

-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Alan Purvis
Sent: Wed 11/29/2006 4:08 PM
To: osg users
Subject: Re: [osg-users] Possible bug in osgDB::Registry::ReadObject()
 
Hmmn, are you sure?

I would have though this an optional optimisation or perhaps an  
artifact of a specific compiler implementation. Does this old true  
across all compilers?

I'm fairly sure I've learnt from past mistakes to create nested ifs  
in situations like this. I could be wrong though.


On 29 Nov 2006, at 18:18, Bradford, Chase wrote:

> When computing an 'and' Boolean statement, the compiler will stop  
> processing the condition as soon as the first false is found, since  
> it will immediately cause the entire statement to be false.  So, if  
> rf == 0, then the second condition won't be evaluated.  The same  
> rule applies to 'or', if a true condition is found, the others are  
> ignored and the conditional returns true.
>
>
>
> From: [EMAIL PROTECTED] [mailto:osg-users- 
> [EMAIL PROTECTED] On Behalf Of Alan Purvis
> Sent: Wednesday, November 29, 2006 9:40 AM
> To: osg users
> Subject: [osg-users] Possible bug in osgDB::Registry::ReadObject()
>
>
>
> Hi,
>
>
>
> While attempting to track down the oddity I posted earlier about  
> loading GLSL programs from .osg files, I've been digging around the  
> source for the .osg loading mechanism (It has taken a while but I  
> think I've finally gotten my head around how the code works), I  
> spotted what I believe to be a potentially fatal bug on line 890 of  
> osgDB::Registry.cpp in the v1.2 source.
>
>
>
> The line and its previous read:
>
>
>
> [889] DotOsgWrapper::ReadFunc rf = mitr->second->getReadFunc();
>
> [890] if (rf && (*rf)(*obj,fr)) iteratorAdvanced = true;
>
>
>
> In the event the function pointer rf is set to NULL on line 889; I  
> believe the if statement on the next line will cause a null pointer  
> dereference. Should this not be written as:
>
>
>
> [890] if (rf) if ((*rf)(*obj,fr)) iteratorAdvanced = true;
>
>
>
> ...in order to protect from this problem?
>
>
>
> Alan.
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/


<<application/ms-tnef>>

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to