[all-commits] [llvm/llvm-project] 8c0798: [WebAssembly] Fix type index block type handling i...

Heejin Ahn via All-commits all-commits at lists.llvm.org
Tue Apr 11 02:05:46 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8c0798f368356e50f59a2598b28e7cac8770ea4c
      https://github.com/llvm/llvm-project/commit/8c0798f368356e50f59a2598b28e7cac8770ea4c
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2023-04-11 (Tue, 11 Apr 2023)

  Changed paths:
    M llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
    M llvm/test/MC/WebAssembly/type-checker-errors.s

  Log Message:
  -----------
  [WebAssembly] Fix type index block type handling in type checker

The current code is
```
      ExpectBlockType = false;
      TC.setLastSig(*Signature.get());
      if (ExpectBlockType)
        NestingStack.back().Sig = *Signature.get();
```

Because of the first line, the third line's `if (ExpectBlockType)` is
always false and we don't get to update `NestingStack.back().Sig`. This
results in not correctly erroring out when the types of remaining values
on the stack do not match the block type if the block type is written in
the form of a function type. We should set `ExpectBlockType` to false
after the `if`.

Reviewed By: sbc100

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




More information about the All-commits mailing list