[PATCH] D55797: [WebAssembly] Make assembler check for proper nesting of control flow.

Wouter van Oortmerssen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 26 09:19:38 PST 2018


aardappel marked 5 inline comments as done.
aardappel added a comment.

@aheejin 
Yes, the parser normally continues after an error, that is out of my control.. unless I put in a hack like consuming all tokens until EOF.

I can make it not pop if there is an error, which is indeed slightly better behavior. Do note that not popping equally can cause unwanted errors:

  try
  loop
  block
  end_if  // I meant to write end_block, error.
  end_loop // now also error
  end_try // now also error

But that should be slightly less likely than your example. Does require a different structure in basic-assembly-errors.s



================
Comment at: test/MC/WebAssembly/basic-assembly-errors.s:13
+    try         # missing end: unmatched
+    if          # missing end: mismatched
+    end_function
----------------
aheejin wrote:
> By the way, can we parse `if`? You commented these out in the other test case saying they are not supported in tablegen.
Yes, they will be added in the next CL. dschuff suggested it was nicer to keep them seperate.


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