1
Fork 0

Fix allocated reg in AT&T style asm

This commit is contained in:
Gary Guo 2021-11-22 17:01:43 +00:00
parent f9534a9bc9
commit 5f0c6e5539

View file

@ -438,6 +438,9 @@ impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> {
generated_asm.push_str(s);
}
InlineAsmTemplatePiece::Placeholder { operand_idx, modifier, span: _ } => {
if self.options.contains(InlineAsmOptions::ATT_SYNTAX) {
generated_asm.push('%');
}
self.registers[*operand_idx]
.unwrap()
.emit(&mut generated_asm, self.arch, *modifier)