Skip to content

Commit 959b8f1

Browse files
committed
add rule on black box/code patching
1 parent a930172 commit 959b8f1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/inline-assembly.md

+5
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,11 @@ r[asm.naked-rules.mem-same-as-ffi]
735735
- Refer to the unsafe code guidelines for the exact rules.
736736
- These rules do not apply to memory which is private to the asm code, such as stack space allocated within the asm block.
737737

738+
r[asm.rules.black-box]
739+
- The compiler cannot assume that the instructions in the asm are the ones that will actually end up executed.
740+
- This effectively means that the compiler must treat the `naked_asm!` as a black box and only take the interface specification into account, not the instructions themselves.
741+
- Runtime code patching is allowed, via target-specific mechanisms.
742+
738743
### Correctness and Validity
739744

740745
r[asm.validity]

0 commit comments

Comments
 (0)