You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/inline-assembly.md
+4-3
Original file line number
Diff line number
Diff line change
@@ -371,6 +371,7 @@ assert_eq!(y, [3, 2, 0, 1]);
371
371
r[asm.operand-type.supported-operands.label]
372
372
*`label <block>`
373
373
- The address of the block is substituted into the asm template string. The assembly code may jump to the substituted address.
374
+
- For targets that distinguish between direct jumps and indirect jumps (e.g. x86-64 with `cf-protection` enabled), the assembly code must not jump to the substituted address indirectly.
374
375
- After execution of the block, the `asm!` expression returns.
375
376
- The type of the block must be unit or `!` (never).
376
377
- The block starts a new safety context; unsafe operations within the `label` block must be wrapped in an inner `unsafe` block, even though the entire `asm!` expression is already wrapped in `unsafe`.
# #[cfg(not(target_arch = "x86_64"))] core::compile_error!("Test not supported on this arch");
1224
1222
```
1225
1223
1224
+
r[asm.options.checks.label-with-outputs]
1225
+
- It is a compile-time error to have any `label` blocks in an asm block with outputs.
1226
+
1226
1227
r[asm.options.naked_asm-restriction]
1227
1228
`naked_asm!` only supports the `att_syntax` and `raw` options. The remaining options are not meaningful because the inline assembly defines the whole function body.
0 commit comments