- Fixed: Reference to freed stack object in R_FindPlane. This caused a massive slowdown (90% drop in total performance) in R_FindPlane when built with optimizations on in GCC6. Although I don't really understand why since the comparison should have been O(1) regardless of memory contents and even if the check failed every plane it would still be pretty fast, this is what they mean when they say that anything can happen when undefined behavior is triggered.

This commit is contained in:
Braden Obrzut 2016-10-30 23:27:29 -04:00
parent ede350ba36
commit 43b2584f79

View file

@ -595,9 +595,10 @@ visplane_t *R_FindPlane (const secplane_t &height, FTextureID picnum, int lightl
fixed_t alpha = FLOAT2FIXED(Alpha); fixed_t alpha = FLOAT2FIXED(Alpha);
//angle_t angle = (xform.Angle + xform.baseAngle).BAMs(); //angle_t angle = (xform.Angle + xform.baseAngle).BAMs();
FTransform nulltransform;
if (picnum == skyflatnum) // killough 10/98 if (picnum == skyflatnum) // killough 10/98
{ // most skies map together { // most skies map together
FTransform nulltransform;
lightlevel = 0; lightlevel = 0;
xform = &nulltransform; xform = &nulltransform;
nulltransform.xOffs = nulltransform.yOffs = nulltransform.baseyOffs = 0; nulltransform.xOffs = nulltransform.yOffs = nulltransform.baseyOffs = 0;