Skip to content

Commit 5e0d476

Browse files
committed
Revises isSingleFloat32Struct
isSingleFloat32Struct currently stops when the current handle is not a value class handle, or it has more than one field. If not, it proceeds to the next step with the assumption that the current. Unfortunately, if the current handle is not a value class, but has one field (somehow), getFieldInClass call raises an assertion failure discussed in #6569. This commit tries to fix this invalid terminating condition.
1 parent a4e5efc commit 5e0d476

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jit/compiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ bool Compiler::isSingleFloat32Struct(CORINFO_CLASS_HANDLE clsHnd)
475475
for (;;)
476476
{
477477
// all of class chain must be of value type and must have only one field
478-
if (!info.compCompHnd->isValueClass(clsHnd) && info.compCompHnd->getClassNumInstanceFields(clsHnd) != 1)
478+
if (!info.compCompHnd->isValueClass(clsHnd) || info.compCompHnd->getClassNumInstanceFields(clsHnd) != 1)
479479
{
480480
return false;
481481
}

0 commit comments

Comments
 (0)