aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorCongcong Cai <congcongcai0907@163.com>2024-02-04 14:24:37 +0800
committerGitHub <noreply@github.com>2024-02-04 14:24:37 +0800
commit9d2e8dca12c8bbb70223eeb74330fe603e215ce3 (patch)
tree14c1196fd15c05cb84a30c4ff91acac20f7b7894 /llvm/lib
parent1b33b3f27f8bf3902d754ed83da29f9a6f15e4e1 (diff)
downloadllvm-9d2e8dca12c8bbb70223eeb74330fe603e215ce3.zip
llvm-9d2e8dca12c8bbb70223eeb74330fe603e215ce3.tar.gz
llvm-9d2e8dca12c8bbb70223eeb74330fe603e215ce3.tar.bz2
[WebAssembly] fix `table.grow` type checker (#80572)
table.grow is valid with type `[t i32] -> [i32]`. Fixes: #79966.
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
index b4db7f6..f81f455 100644
--- a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
+++ b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
@@ -297,6 +297,8 @@ bool WebAssemblyAsmTypeCheck::typeCheck(SMLoc ErrorLoc, const MCInst &Inst,
return true;
if (popType(ErrorLoc, wasm::ValType::I32))
return true;
+ if (popType(ErrorLoc, Type))
+ return true;
Stack.push_back(wasm::ValType::I32);
} else if (Name == "table.fill") {
if (getTable(Operands[1]->getStartLoc(), Inst, Type))