Skip to content

Commit

Permalink
[WebAssembly] Fixed relocation errors having no location.
Browse files Browse the repository at this point in the history
Summary:
Fixes: https://bugs.llvm.org/show_bug.cgi?id=42441

Used to print:

<unknown>:0: error: Cannot represent a difference across sections

(the location was null).

Now prints:

err.s:20:3: error: Cannot represent a difference across sections
  i32.const foo-bar
  ^

Note: I looked at adding a test for this, but I don't think it is
worth it. We're not testing error formatting in the Wasm backend :)

Reviewers: sbc100, jgravelle-google

Subscribers: dschuff, aheejin, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65602

llvm-svn: 367619
  • Loading branch information
aardappel committed Aug 1, 2019
1 parent 84586c1 commit 7fee93e
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -763,6 +763,7 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
uint64_t &ErrorInfo,
bool MatchingInlineAsm) override {
MCInst Inst;
Inst.setLoc(IDLoc);
unsigned MatchResult =
MatchInstructionImpl(Operands, Inst, ErrorInfo, MatchingInlineAsm);
switch (MatchResult) {
Expand Down

0 comments on commit 7fee93e

Please sign in to comment.