[PATCH] D99960: [WebAssembly] Improve error messages regarding missing indirect function table. NFC

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 7 07:59:13 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf23b259e1877: [WebAssembly] Improve error messages regarding missing indirect function table. (authored by sbc100).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99960/new/

https://reviews.llvm.org/D99960

Files:
  llvm/lib/MC/WasmObjectWriter.cpp


Index: llvm/lib/MC/WasmObjectWriter.cpp
===================================================================
--- llvm/lib/MC/WasmObjectWriter.cpp
+++ llvm/lib/MC/WasmObjectWriter.cpp
@@ -536,11 +536,11 @@
     // We require the function table to have already been defined.
     auto TableName = "__indirect_function_table";
     MCSymbolWasm *Sym = cast_or_null<MCSymbolWasm>(Ctx.lookupSymbol(TableName));
-    if (!Sym || !Sym->isFunctionTable()) {
-      Ctx.reportError(
-          Fixup.getLoc(),
-          "symbol '__indirect_function_table' is not a function table");
+    if (!Sym) {
+      report_fatal_error("missing indirect function table symbol");
     } else {
+      if (!Sym->isFunctionTable())
+        report_fatal_error("__indirect_function_table symbol has wrong type");
       // Ensure that __indirect_function_table reaches the output.
       Sym->setNoStrip();
       Asm.registerSymbol(*Sym);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99960.335810.patch
Type: text/x-patch
Size: 917 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210407/215a421b/attachment.bin>


More information about the llvm-commits mailing list