Skip to content

Commit d8942f1

Browse files
committed
add rule on black box/code patching
1 parent 38f0397 commit d8942f1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: src/inline-assembly.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1372,11 +1372,10 @@ r[asm.naked-rules.mem-same-as-ffi]
13721372
- Refer to the unsafe code guidelines for the exact rules.
13731373
- These rules do not apply to memory which is private to the asm code, such as stack space allocated within the asm block.
13741374

1375-
r[asm.naked-rules.black-box]
1375+
r[asm.rules.black-box]
13761376
- The compiler cannot assume that the instructions in the asm are the ones that will actually end up executed.
13771377
- 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.
13781378
- Runtime code patching is allowed, via target-specific mechanisms.
1379-
- However there is no guarantee that each `naked_asm!` directly corresponds to a single instance of instructions in the object file: the compiler is free to duplicate or deduplicate `naked_asm!` blocks.
13801379

13811380
r[asm.validity]
13821381
### Correctness and Validity

0 commit comments

Comments
 (0)