Add missing clobbers to context switching

This only shows in release mode, the compiler tries to preserve some
value in rdi, but that gets replaced inside the fiber. This would not
happen in the C calling convention, but in these normal Zig functions,
it can happen.
This commit is contained in:
Lukas Lalinsky 2025-10-09 08:52:52 +02:00 committed by Andrew Kelley
parent 88693a56fc
commit 2b5306a94b

View File

@ -644,6 +644,7 @@ inline fn contextSwitch(message: *const SwitchMessage) *const SwitchMessage {
: [received_message] "={x1}" (-> *const @FieldType(SwitchMessage, "contexts")), : [received_message] "={x1}" (-> *const @FieldType(SwitchMessage, "contexts")),
: [message_to_send] "{x1}" (&message.contexts), : [message_to_send] "{x1}" (&message.contexts),
: .{ : .{
.x0 = true,
.x1 = true, .x1 = true,
.x2 = true, .x2 = true,
.x3 = true, .x3 = true,
@ -745,6 +746,7 @@ inline fn contextSwitch(message: *const SwitchMessage) *const SwitchMessage {
.rdx = true, .rdx = true,
.rbx = true, .rbx = true,
.rsi = true, .rsi = true,
.rdi = true,
.r8 = true, .r8 = true,
.r9 = true, .r9 = true,
.r10 = true, .r10 = true,