From a8b4f9e5f6cbf24bbd762ffbfc9d5bede0d2a5e2 Mon Sep 17 00:00:00 2001 From: dhewg Date: Wed, 4 Jan 2012 23:06:27 +0100 Subject: [PATCH] Fix miscompilation with gcc 4.5 idAnimator::GetJointLocalTransform() miscompiles with gcc 4.5 and -ftree-vrp (implied by -O2). Reorder code to avoid the compiler bug, no functional change. --- game/anim/Anim_Blend.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/game/anim/Anim_Blend.cpp b/game/anim/Anim_Blend.cpp index 2bcd452..0cbd4af 100644 --- a/game/anim/Anim_Blend.cpp +++ b/game/anim/Anim_Blend.cpp @@ -4472,16 +4472,18 @@ bool idAnimator::GetJointLocalTransform( jointHandle_t jointHandle, int currentT // FIXME: overkill CreateFrame( currentTime, false ); - if ( jointHandle > 0 ) { - idJointMat m = joints[ jointHandle ]; - m /= joints[ modelJoints[ jointHandle ].parentNum ]; - offset = m.ToVec3(); - axis = m.ToMat3(); - } else { + if ( jointHandle == 0 ) { offset = joints[ jointHandle ].ToVec3(); axis = joints[ jointHandle ].ToMat3(); + + return true; } + idJointMat m = joints[ jointHandle ]; + m /= joints[ modelJoints[ jointHandle ].parentNum ]; + offset = m.ToVec3(); + axis = m.ToMat3(); + return true; }