authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-09 05:19:11+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-09 17:53:04+02:00
logf376cbc37b38794857e63bffc3766ad5cb8482c2
tree44b867e1f8c41dea626fb054b68334fe226f4e85
parent4a9c642b64a7f24e9a57a0c8f45961a28dd871e9
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.debug.cpu_context.Sparc: align to 8 bytes to make std on 32-bit safe

Otherwise we might get SIGBUS due to misalignment.

1 files changed, 51 insertions(+), 51 deletions(-)

lib/std/debug/cpu_context.zig+51-51
...@@ -1517,7 +1517,7 @@ const S390x = extern struct {...@@ -1517,7 +1517,7 @@ const S390x = extern struct {
15171517
1518/// This is an `extern struct` so that inline assembly in `current` can use field offsets.1518/// This is an `extern struct` so that inline assembly in `current` can use field offsets.
1519const Sparc = extern struct {1519const Sparc = extern struct {
1520 g: [8]Gpr,1520 g: [8]Gpr align(8), // Align to make `std` safe on 32-bit.
1521 o: [8]Gpr,1521 o: [8]Gpr,
1522 l: [8]Gpr,1522 l: [8]Gpr,
1523 i: [8]Gpr,1523 i: [8]Gpr,
...@@ -1530,63 +1530,63 @@ const Sparc = extern struct {...@@ -1530,63 +1530,63 @@ const Sparc = extern struct {
15301530
1531 var ctx: Sparc = undefined;1531 var ctx: Sparc = undefined;
1532 asm volatile (if (Gpr == u64)1532 asm volatile (if (Gpr == u64)
1533 \\ stx %g0, [%l0 + 0]1533 \\ stx %%g0, [%%l0 + 0]
1534 \\ stx %g1, [%l0 + 8]1534 \\ stx %%g1, [%%l0 + 8]
1535 \\ stx %g2, [%l0 + 16]1535 \\ stx %%g2, [%%l0 + 16]
1536 \\ stx %g3, [%l0 + 24]1536 \\ stx %%g3, [%%l0 + 24]
1537 \\ stx %g4, [%l0 + 32]1537 \\ stx %%g4, [%%l0 + 32]
1538 \\ stx %g5, [%l0 + 40]1538 \\ stx %%g5, [%%l0 + 40]
1539 \\ stx %g6, [%l0 + 48]1539 \\ stx %%g6, [%%l0 + 48]
1540 \\ stx %g7, [%l0 + 56]1540 \\ stx %%g7, [%%l0 + 56]
1541 \\ stx %o0, [%l0 + 64]1541 \\ stx %%o0, [%%l0 + 64]
1542 \\ stx %o1, [%l0 + 72]1542 \\ stx %%o1, [%%l0 + 72]
1543 \\ stx %o2, [%l0 + 80]1543 \\ stx %%o2, [%%l0 + 80]
1544 \\ stx %o3, [%l0 + 88]1544 \\ stx %%o3, [%%l0 + 88]
1545 \\ stx %o4, [%l0 + 96]1545 \\ stx %%o4, [%%l0 + 96]
1546 \\ stx %o5, [%l0 + 104]1546 \\ stx %%o5, [%%l0 + 104]
1547 \\ stx %o6, [%l0 + 112]1547 \\ stx %%o6, [%%l0 + 112]
1548 \\ stx %o7, [%l0 + 120]1548 \\ stx %%o7, [%%l0 + 120]
1549 \\ stx %l0, [%l0 + 128]1549 \\ stx %%l0, [%%l0 + 128]
1550 \\ stx %l1, [%l0 + 136]1550 \\ stx %%l1, [%%l0 + 136]
1551 \\ stx %l2, [%l0 + 144]1551 \\ stx %%l2, [%%l0 + 144]
1552 \\ stx %l3, [%l0 + 152]1552 \\ stx %%l3, [%%l0 + 152]
1553 \\ stx %l4, [%l0 + 160]1553 \\ stx %%l4, [%%l0 + 160]
1554 \\ stx %l5, [%l0 + 168]1554 \\ stx %%l5, [%%l0 + 168]
1555 \\ stx %l6, [%l0 + 176]1555 \\ stx %%l6, [%%l0 + 176]
1556 \\ stx %l7, [%l0 + 184]1556 \\ stx %%l7, [%%l0 + 184]
1557 \\ stx %i0, [%l0 + 192]1557 \\ stx %%i0, [%%l0 + 192]
1558 \\ stx %i1, [%l0 + 200]1558 \\ stx %%i1, [%%l0 + 200]
1559 \\ stx %i2, [%l0 + 208]1559 \\ stx %%i2, [%%l0 + 208]
1560 \\ stx %i3, [%l0 + 216]1560 \\ stx %%i3, [%%l0 + 216]
1561 \\ stx %i4, [%l0 + 224]1561 \\ stx %%i4, [%%l0 + 224]
1562 \\ stx %i5, [%l0 + 232]1562 \\ stx %%i5, [%%l0 + 232]
1563 \\ stx %i6, [%l0 + 240]1563 \\ stx %%i6, [%%l0 + 240]
1564 \\ stx %i7, [%l0 + 248]1564 \\ stx %%i7, [%%l0 + 248]
1565 \\ call 1f1565 \\ call 1f
1566 \\ nop1566 \\ nop
1567 \\1:1567 \\1:
1568 \\ stx %o7, [%l0 + 256]1568 \\ stx %%o7, [%%l0 + 256]
1569 else1569 else
1570 \\ std %g0, [%l0 + 0]1570 \\ std %%g0, [%%l0 + 0]
1571 \\ std %g2, [%l0 + 8]1571 \\ std %%g2, [%%l0 + 8]
1572 \\ std %g4, [%l0 + 16]1572 \\ std %%g4, [%%l0 + 16]
1573 \\ std %g6, [%l0 + 24]1573 \\ std %%g6, [%%l0 + 24]
1574 \\ std %o0, [%l0 + 32]1574 \\ std %%o0, [%%l0 + 32]
1575 \\ std %o2, [%l0 + 40]1575 \\ std %%o2, [%%l0 + 40]
1576 \\ std %o4, [%l0 + 48]1576 \\ std %%o4, [%%l0 + 48]
1577 \\ std %o6, [%l0 + 56]1577 \\ std %%o6, [%%l0 + 56]
1578 \\ std %l0, [%l0 + 64]1578 \\ std %%l0, [%%l0 + 64]
1579 \\ std %l2, [%l0 + 72]1579 \\ std %%l2, [%%l0 + 72]
1580 \\ std %l4, [%l0 + 80]1580 \\ std %%l4, [%%l0 + 80]
1581 \\ std %l6, [%l0 + 88]1581 \\ std %%l6, [%%l0 + 88]
1582 \\ std %i0, [%l0 + 96]1582 \\ std %%i0, [%%l0 + 96]
1583 \\ std %i2, [%l0 + 104]1583 \\ std %%i2, [%%l0 + 104]
1584 \\ std %i4, [%l0 + 112]1584 \\ std %%i4, [%%l0 + 112]
1585 \\ std %i6, [%l0 + 120]1585 \\ std %%i6, [%%l0 + 120]
1586 \\ call 1f1586 \\ call 1f
1587 \\ nop1587 \\ nop
1588 \\1:1588 \\1:
1589 \\ st %o7, [%l0 + 128]1589 \\ st %%o7, [%%l0 + 128]
1590 :1590 :
1591 : [ctx] "{l0}" (&ctx),1591 : [ctx] "{l0}" (&ctx),
1592 : .{ .o7 = true, .memory = true });1592 : .{ .o7 = true, .memory = true });