[sldev] Re: LLOctree crash (weird crash)

Dylan Alex Simon dylan at dylex.net
Wed Jan 24 18:36:22 PST 2007


There's a octree crash on gcc 4.1.1 due to a LLVector3 cast of the data's
positionGroup.  This results in an infinite loop passing up and down, because
the newly created child is created in the LLVector3 position, but compared
isInside with the LLVector3d position.  For example, a position might be
30.0000000001, which as a F32 is not > 30, but as a F64, is.  Fix is below.

:-Dylan

--- linden-1.13.2.12/indra/llmath/lloctree.h	2007-01-19 23:26:35.000000000 -0500
+++ linden/indra/llmath/lloctree.h	2007-01-24 21:10:24.000000000 -0500
@@ -189,17 +189,11 @@
 
 	static void pushCenter(LLVector3d &center, LLVector3d &size, T* data)
 	{
-		LLVector3 pos(data->getPositionGroup());
-		F64 p[] =
-		{
-			(F64) pos.mV[0],
-			(F64) pos.mV[1],
-			(F64) pos.mV[2]
-		};
+		LLVector3d pos(data->getPositionGroup());
 			
 		for (U32 i = 0; i < 3; i++)
 		{
-			if (p[i] > center.mdV[i])
+			if (pos.mdV[i] > center.mdV[i])
 			{
 				center.mdV[i] += size.mdV[i];
 			}



More information about the SLDev mailing list