@@ -1414,12 +1414,14 @@ static void singlePayloadEnumSimpleAssignWithCopy(const Metadata *metadata,
1414
1414
if (srcTagBytes >= xiTagValues && destTagBytes >= xiTagValues) {
1415
1415
return ;
1416
1416
} else if (destTagBytes >= xiTagValues) {
1417
- while (reader.layoutStr < (reader.layoutStr + refCountBytes)) {
1417
+ const uint8_t *end = (reader.layoutStr + refCountBytes);
1418
+ while (reader.layoutStr < end) {
1418
1419
handleSingleRefCountInitWithCopy (metadata, reader, addrOffset, dest, src);
1419
1420
}
1420
1421
return ;
1421
1422
} else if (srcTagBytes >= xiTagValues) {
1422
- while (reader.layoutStr < (reader.layoutStr + refCountBytes)) {
1423
+ const uint8_t *end = (reader.layoutStr + refCountBytes);
1424
+ while (reader.layoutStr < end) {
1423
1425
handleSingleRefCountDestroy (metadata, reader, addrOffset, dest);
1424
1426
}
1425
1427
} else {
@@ -1448,12 +1450,14 @@ static void singlePayloadEnumFNAssignWithCopy(const Metadata *metadata,
1448
1450
if (SWIFT_UNLIKELY (srcTag == 0 && destTag == 0 )) {
1449
1451
return ;
1450
1452
} else if (srcTag == 0 ) {
1451
- while (reader.layoutStr < (reader.layoutStr + refCountBytes)) {
1453
+ const uint8_t *end = (reader.layoutStr + refCountBytes);
1454
+ while (reader.layoutStr < end) {
1452
1455
handleSingleRefCountInitWithCopy (metadata, reader, addrOffset, dest, src);
1453
1456
}
1454
1457
return ;
1455
1458
} else if (destTag == 0 ) {
1456
- while (reader.layoutStr < (reader.layoutStr + refCountBytes)) {
1459
+ const uint8_t *end = (reader.layoutStr + refCountBytes);
1460
+ while (reader.layoutStr < end) {
1457
1461
handleSingleRefCountDestroy (metadata, reader, addrOffset, dest);
1458
1462
}
1459
1463
} else {
@@ -1482,12 +1486,14 @@ static void singlePayloadEnumFNResolvedAssignWithCopy(const Metadata *metadata,
1482
1486
if (SWIFT_UNLIKELY (srcTag == 0 && destTag == 0 )) {
1483
1487
return ;
1484
1488
} else if (srcTag == 0 ) {
1485
- while (reader.layoutStr < (reader.layoutStr + refCountBytes)) {
1489
+ const uint8_t *end = (reader.layoutStr + refCountBytes);
1490
+ while (reader.layoutStr < end) {
1486
1491
handleSingleRefCountInitWithCopy (metadata, reader, addrOffset, dest, src);
1487
1492
}
1488
1493
return ;
1489
1494
} else if (destTag == 0 ) {
1490
- while (reader.layoutStr < (reader.layoutStr + refCountBytes)) {
1495
+ const uint8_t *end = (reader.layoutStr + refCountBytes);
1496
+ while (reader.layoutStr < end) {
1491
1497
handleSingleRefCountDestroy (metadata, reader, addrOffset, dest);
1492
1498
}
1493
1499
} else {
@@ -1541,12 +1547,14 @@ static void singlePayloadEnumGenericAssignWithCopy(const Metadata *metadata,
1541
1547
if (SWIFT_UNLIKELY (srcTag == 0 && destTag == 0 )) {
1542
1548
return ;
1543
1549
} else if (srcTag == 0 ) {
1544
- while (reader.layoutStr < (reader.layoutStr + refCountBytes)) {
1550
+ const uint8_t *end = (reader.layoutStr + refCountBytes);
1551
+ while (reader.layoutStr < end) {
1545
1552
handleSingleRefCountInitWithCopy (metadata, reader, addrOffset, dest, src);
1546
1553
}
1547
1554
return ;
1548
1555
} else if (destTag == 0 ) {
1549
- while (reader.layoutStr < (reader.layoutStr + refCountBytes)) {
1556
+ const uint8_t *end = (reader.layoutStr + refCountBytes);
1557
+ while (reader.layoutStr < end) {
1550
1558
handleSingleRefCountDestroy (metadata, reader, addrOffset, dest);
1551
1559
}
1552
1560
} else {
0 commit comments