- fixed: ZCC_OpInfoType::FindBestProto was missing checks for exact match of the required conversion before testing if it is a F32->F64 conversion.

Of course, since 0 means that there is no conversion it also means that there is no data that could be checked.
This commit is contained in:
Christoph Oelckers 2016-10-06 12:08:38 +02:00
parent c56d2eecb0
commit d7bb5bb41e

View file

@ -162,11 +162,11 @@ ZCC_OpProto *ZCC_OpInfoType::FindBestProto(
// [[float32 (op) int]] will choose the integer version instead of the floating point
// version, which we do not want.
int test_dist1 = dist1, test_dist2 = dist2;
if (routes[0][cur_route1][0]->ConvertConstant == FtoD)
if (test_dist1 > 0 && routes[0][cur_route1][0]->ConvertConstant == FtoD)
{
test_dist1--;
}
if (routes[1][cur_route2][0]->ConvertConstant == FtoD)
if (test_dist2 > 0 && routes[1][cur_route2][0]->ConvertConstant == FtoD)
{
test_dist2--;
}