Skip to content

Commit e3a1bac

Browse files
committed
[Runtime] Use copy of addrOffset in single payload assign with copy
1 parent b7bde13 commit e3a1bac

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

stdlib/public/runtime/BytecodeLayouts.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,8 +1412,9 @@ static void singlePayloadEnumSimpleAssignWithCopy(const Metadata *metadata,
14121412
return;
14131413
} else if (destTagBytes >= xiTagValues) {
14141414
const uint8_t *end = (reader.layoutStr + refCountBytes);
1415+
auto nestedAddrOffset = addrOffset;
14151416
while (reader.layoutStr < end) {
1416-
handleSingleRefCountDestroy(metadata, reader, addrOffset, dest);
1417+
handleSingleRefCountDestroy(metadata, reader, nestedAddrOffset, dest);
14171418
}
14181419
} else {
14191420
reader.skip(refCountBytes);
@@ -1448,8 +1449,9 @@ static void singlePayloadEnumFNAssignWithCopy(const Metadata *metadata,
14481449
return;
14491450
} else if (destTag == 0) {
14501451
const uint8_t *end = (reader.layoutStr + refCountBytes);
1452+
auto nestedAddrOffset = addrOffset;
14511453
while (reader.layoutStr < end) {
1452-
handleSingleRefCountDestroy(metadata, reader, addrOffset, dest);
1454+
handleSingleRefCountDestroy(metadata, reader, nestedAddrOffset, dest);
14531455
}
14541456
} else {
14551457
reader.skip(refCountBytes);
@@ -1484,8 +1486,9 @@ static void singlePayloadEnumFNResolvedAssignWithCopy(const Metadata *metadata,
14841486
return;
14851487
} else if (destTag == 0) {
14861488
const uint8_t *end = (reader.layoutStr + refCountBytes);
1489+
auto nestedAddrOffset = addrOffset;
14871490
while (reader.layoutStr < end) {
1488-
handleSingleRefCountDestroy(metadata, reader, addrOffset, dest);
1491+
handleSingleRefCountDestroy(metadata, reader, nestedAddrOffset, dest);
14891492
}
14901493
} else {
14911494
reader.skip(refCountBytes);
@@ -1545,8 +1548,9 @@ static void singlePayloadEnumGenericAssignWithCopy(const Metadata *metadata,
15451548
return;
15461549
} else if (destTag == 0) {
15471550
const uint8_t *end = (reader.layoutStr + refCountBytes);
1551+
auto nestedAddrOffset = addrOffset;
15481552
while (reader.layoutStr < end) {
1549-
handleSingleRefCountDestroy(metadata, reader, addrOffset, dest);
1553+
handleSingleRefCountDestroy(metadata, reader, nestedAddrOffset, dest);
15501554
}
15511555
} else {
15521556
reader.skip(refCountBytes);

0 commit comments

Comments
 (0)