[PATCH] D63694: [lld/WebAssembly] Slightly nicer error message for malformed input files

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 16:19:28 PDT 2019


sbc100 added a comment.

Thanks!



================
Comment at: lld/wasm/InputFiles.cpp:56
+    std::unique_ptr<Binary> Bin = CHECK(createBinary(MB),
+      "While processing `" + MB.getBufferIdentifier() + "`");
     auto *Obj = cast<WasmObjectFile>(Bin.get());
----------------
I think just `MB.getBufferIdentifier()` should be enough.  Our other error message don't include the "While processing" prefix, but the filename is certainly useful.

We should find a way to make a test.  Perhaps you can do something like " echo <WASM_MAGIC>foo" > "test.o" in order to generate a bad object file.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63694





More information about the llvm-commits mailing list