Skip to content

Commit

Permalink
Fix ice-72487
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdd0121 committed May 23, 2020
1 parent 215f2d3 commit e04baed
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/librustc_target/asm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,19 @@ impl InlineAsmReg {
name: Symbol,
) -> Result<Self, &'static str> {
// FIXME: use direct symbol comparison for register names
name.with(|name| {
Ok(match arch {
InlineAsmArch::X86 | InlineAsmArch::X86_64 => {
Self::X86(X86InlineAsmReg::parse(arch, has_feature, name)?)
}
InlineAsmArch::Arm => Self::Arm(ArmInlineAsmReg::parse(arch, has_feature, name)?),
InlineAsmArch::AArch64 => {
Self::AArch64(AArch64InlineAsmReg::parse(arch, has_feature, name)?)
}
InlineAsmArch::RiscV32 | InlineAsmArch::RiscV64 => {
Self::RiscV(RiscVInlineAsmReg::parse(arch, has_feature, name)?)
}
})
// Use `Symbol::as_str` instead of `Symbol::with` here because `has_feature` may access `Symbol`.
let name = name.as_str();
Ok(match arch {
InlineAsmArch::X86 | InlineAsmArch::X86_64 => {
Self::X86(X86InlineAsmReg::parse(arch, has_feature, &name)?)
}
InlineAsmArch::Arm => Self::Arm(ArmInlineAsmReg::parse(arch, has_feature, &name)?),
InlineAsmArch::AArch64 => {
Self::AArch64(AArch64InlineAsmReg::parse(arch, has_feature, &name)?)
}
InlineAsmArch::RiscV32 | InlineAsmArch::RiscV64 => {
Self::RiscV(RiscVInlineAsmReg::parse(arch, has_feature, &name)?)
}
})
}

Expand Down

0 comments on commit e04baed

Please sign in to comment.