Skip to content

Commit ea00bfd

Browse files
committed
Unsafe blocks are now required in unsafe fns too (since #328)
1 parent c449106 commit ea00bfd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/instructions/interrupts.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,7 @@ pub fn int3() {
164164
doc(cfg(any(feature = "nightly", feature = "inline_asm")))
165165
)]
166166
pub unsafe fn software_interrupt<const NUM: u8>() {
167-
asm!("int {num}", num = const NUM, options(nomem, nostack));
167+
unsafe {
168+
asm!("int {num}", num = const NUM, options(nomem, nostack));
169+
}
168170
}

src/structures/idt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ impl<F> Entry<F> {
762762

763763
self.options = EntryOptions::minimal();
764764
// SAFETY: The current CS is a valid, long-mode code segment.
765-
self.options.set_code_selector(CS::get_reg());
765+
unsafe { self.options.set_code_selector(CS::get_reg()) };
766766
self.options.set_present(true);
767767
&mut self.options
768768
}

0 commit comments

Comments
 (0)