[PATCH] D55797: [WebAssembly] Make assembler check for proper nesting of control flow.
Heejin Ahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 20 16:18:54 PST 2018
aheejin added inline comments.
================
Comment at: lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp:405
+ } else if (BaseName == "end_function") {
+ if (Pop(Function) || CheckFunctionEnd())
+ return true;
----------------
aardappel wrote:
> aheejin wrote:
> > Did you mean to use `&&`? Not sure if `||` makes sense here
> in the parser, functions return true on failure.. which is a bit odd, yes.
Ah I see.
================
Comment at: test/MC/WebAssembly/basic-assembly-errors.s:16
+.Lfunc_end0:
+ .size test0, .Lfunc_end0-test0
+
----------------
Indent the same way with other lines
================
Comment at: test/MC/WebAssembly/basic-assembly-errors.s:22
+# CHECK: Block construct type mismatch, expected: if, instead got: function
+# CHECK: error: Unmatched block construct(s) at function end: try
----------------
These error messages are a little confusing, because we have `end_loop` in the code but the error message says "we got loop". The same for all other messages. I guess we should change the message to reflect the actual instructions in the test?
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55797/new/
https://reviews.llvm.org/D55797
More information about the llvm-commits
mailing list