Skip to content

Commit d9c8adf

Browse files
committed
fix: do not use rbx register in asm!()
error: invalid register `rbx`: rbx is used internally by LLVM and cannot be used as an operand for inline asm See: rust-lang/rust#84658 (comment) and: https://github.com/rust-lang/rust/pull/84658/files#diff-d7283132d97a993fad4e2d491ac883dbce4e17fe248cdf37fa3f9334e2a5a115
1 parent 9e3617b commit d9c8adf

File tree

1 file changed

+3
-1
lines changed
  • src/attestation_types

1 file changed

+3
-1
lines changed

src/attestation_types/ti.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ impl TargetInfo {
5050
let mut report = core::mem::MaybeUninit::<report::Report>::uninit();
5151

5252
asm!(
53+
"xchg {RBX}, rbx",
5354
"enclu",
55+
"mov rbx, {RBX}",
5456

57+
RBX = inout(reg) self => _,
5558
in("rax") EREPORT,
56-
in("rbx") self,
5759
in("rcx") data.0.as_ptr(),
5860
in("rdx") report.as_mut_ptr(),
5961
);

0 commit comments

Comments
 (0)