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.
This commit is contained in:
dhewg 2012-01-04 23:06:27 +01:00
parent 8ae3ab7641
commit 3c96e19610

View file

@ -4472,15 +4472,17 @@ bool idAnimator::GetJointLocalTransform( jointHandle_t jointHandle, int currentT
// FIXME: overkill // FIXME: overkill
CreateFrame( currentTime, false ); CreateFrame( currentTime, false );
if ( jointHandle > 0 ) { if ( jointHandle == 0 ) {
offset = joints[ jointHandle ].ToVec3();
axis = joints[ jointHandle ].ToMat3();
return true;
}
idJointMat m = joints[ jointHandle ]; idJointMat m = joints[ jointHandle ];
m /= joints[ modelJoints[ jointHandle ].parentNum ]; m /= joints[ modelJoints[ jointHandle ].parentNum ];
offset = m.ToVec3(); offset = m.ToVec3();
axis = m.ToMat3(); axis = m.ToMat3();
} else {
offset = joints[ jointHandle ].ToVec3();
axis = joints[ jointHandle ].ToMat3();
}
return true; return true;
} }