Doing a FQuat*FQuat when one of them is a parameter-by-value in non-debug builds causes access violation

rajkosto
Thu, 30 Oct 2014 10:40:34 +0000
Debugging, Optimization, & Profiling

static FRotator GetConversionRotator()
{
const auto mineToUE4 = FRotator::MakeFromEuler(FVector(-90,0,90));
return mineToUE4;
}

FQuat ConvertToUe4Rotation(FQuat inputQuat)
{
	const FQuat rotQuat = FQuat(GetConversionRotator());
	const FQuat newQuat = inputQuat * rotQuat;
	return newQuat;
}

then just call it like this

FQuat xformRot = FQuat::Identity;
//...populate xformRot here maybe
xformRot = ConvertToUe4Rotation(xformRot);

The line const FQuat newQuat = inputQuat * rotQuat; will access violate on non-debug builds.
Debug builds are fine, and changing inputQuat to be const FQuat& works around the issue.

Win64 Development Editor 4.5.1 github 4.5 branch commit ad6f983017ba127247a9fbbbae10056211cff0af
compiled with vs2013 update 3

15 posts - 1 participant