mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 02:33:06 +01:00
[WebAssembly] fix typo in range check for Asm locals
This commit is contained in:
parent
d0157d4fd5
commit
714dda98bc
@ -102,8 +102,8 @@ bool WebAssemblyAsmTypeCheck::popType(SMLoc ErrorLoc,
|
||||
|
||||
bool WebAssemblyAsmTypeCheck::getLocal(SMLoc ErrorLoc, const MCInst &Inst,
|
||||
wasm::ValType &Type) {
|
||||
auto Local = Inst.getOperand(0).getImm();
|
||||
if (static_cast<size_t>(Local) > LocalTypes.size())
|
||||
auto Local = static_cast<size_t>(Inst.getOperand(0).getImm());
|
||||
if (Local >= LocalTypes.size())
|
||||
return typeError(ErrorLoc, StringRef("no local type specified for index ") +
|
||||
std::to_string(Local));
|
||||
Type = LocalTypes[Local];
|
||||
|
Loading…
Reference in New Issue
Block a user