mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2026-02-27 13:23:04 +00:00
kernel: prefer std::addressof
This commit is contained in:
@@ -930,14 +930,14 @@ Result KThread::GetThreadContext3(std::vector<u8>& out) {
|
||||
context.pstate &= 0xFF0FFE20;
|
||||
|
||||
out.resize(sizeof(context));
|
||||
std::memcpy(out.data(), &context, sizeof(context));
|
||||
std::memcpy(out.data(), std::addressof(context), sizeof(context));
|
||||
} else {
|
||||
// Mask away mode bits, interrupt bits, IL bit, and other reserved bits.
|
||||
auto context = GetContext32();
|
||||
context.cpsr &= 0xFF0FFE20;
|
||||
|
||||
out.resize(sizeof(context));
|
||||
std::memcpy(out.data(), &context, sizeof(context));
|
||||
std::memcpy(out.data(), std::addressof(context), sizeof(context));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user