1
0
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:
Wouter van Oortmerssen 2021-07-12 13:06:54 -07:00
parent d0157d4fd5
commit 714dda98bc

View File

@ -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];