@@ -1315,6 +1315,19 @@ bool CLR_RT_HeapBlock::ObjectsEqual(
1315
1315
break ;
1316
1316
1317
1317
case DATATYPE_STRING:
1318
+ case DATATYPE_CLASS:
1319
+ case DATATYPE_BOOLEAN:
1320
+ case DATATYPE_CHAR:
1321
+ case DATATYPE_I1:
1322
+ case DATATYPE_U1:
1323
+ case DATATYPE_I2:
1324
+ case DATATYPE_U2:
1325
+ case DATATYPE_I4:
1326
+ case DATATYPE_U4:
1327
+ case DATATYPE_I8:
1328
+ case DATATYPE_U8:
1329
+ case DATATYPE_DATETIME:
1330
+ case DATATYPE_TIMESPAN:
1318
1331
return Compare_Values (pArgLeft, pArgRight, false ) == 0 ;
1319
1332
break ;
1320
1333
@@ -1364,53 +1377,6 @@ bool CLR_RT_HeapBlock::ObjectsEqual(
1364
1377
}
1365
1378
break ;
1366
1379
1367
- case DATATYPE_CLASS:
1368
- {
1369
- const CLR_RT_HeapBlock *objLeft = &pArgLeft;
1370
- const CLR_RT_HeapBlock *objRight = &pArgRight;
1371
-
1372
- CLR_RT_TypeDef_Instance classLeftObj;
1373
- classLeftObj.InitializeFromIndex (objLeft->ObjectCls ());
1374
- CLR_RT_TypeDef_Instance classRightObj;
1375
- classRightObj.InitializeFromIndex (objRight->ObjectCls ());
1376
-
1377
- if (classLeftObj.m_data == classRightObj.m_data )
1378
- {
1379
- // this has been already checked above, still adding it here for completeness
1380
- if (&pArgLeft == &pArgRight)
1381
- {
1382
- return true ;
1383
- }
1384
-
1385
- // check if the objects have the same number of fields
1386
- int leftClassTotFields = classLeftObj.CrossReference ().m_totalFields ;
1387
- int rightClassTotFields = classRightObj.CrossReference ().m_totalFields ;
1388
-
1389
- if (leftClassTotFields > 0 && rightClassTotFields > 0 && leftClassTotFields == rightClassTotFields)
1390
- {
1391
- int equalFieldsCount = 0 ;
1392
- int totalFieldsCount = leftClassTotFields;
1393
-
1394
- // loop through the fields and compare them
1395
- do
1396
- {
1397
- if (ObjectsEqual (
1398
- objLeft[leftClassTotFields + CLR_RT_HeapBlock::HB_Object_Fields_Offset],
1399
- objRight[rightClassTotFields + CLR_RT_HeapBlock::HB_Object_Fields_Offset],
1400
- false ))
1401
- {
1402
- // fields are equal
1403
- equalFieldsCount++;
1404
- }
1405
- } while (--leftClassTotFields > 0 );
1406
-
1407
- // check if all fields are equal
1408
- return equalFieldsCount == totalFieldsCount;
1409
- }
1410
- }
1411
- }
1412
- break ;
1413
-
1414
1380
default :
1415
1381
1416
1382
if ((leftDataType == rightDataType) && fSameReference == false )
@@ -1686,7 +1652,7 @@ CLR_INT32 CLR_RT_HeapBlock::Compare_Values(const CLR_RT_HeapBlock &left, const C
1686
1652
// deal with special cases:
1687
1653
// return 0 if the numbers are unordered (either or both are NaN)
1688
1654
// this is post processed in interpreter so '1' will turn into '0'
1689
- if (__isnand (left.NumericByRefConst ().r4 ) || __isnand (right.NumericByRefConst ().r4 ))
1655
+ if (__isnand (left.NumericByRefConst ().r4 ) && __isnand (right.NumericByRefConst ().r4 ))
1690
1656
{
1691
1657
return 1 ;
1692
1658
}
0 commit comments