[all-commits] [llvm/llvm-project] 7e6793: [WebAssembly] Generate unreachable after __stack_c...

Heejin Ahn via All-commits all-commits at lists.llvm.org
Wed Jul 8 01:02:29 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7e6793aa33dd61ed9dd531871fce30c1b7978e13
      https://github.com/llvm/llvm-project/commit/7e6793aa33dd61ed9dd531871fce30c1b7978e13
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2020-07-08 (Wed, 08 Jul 2020)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/test/CodeGen/WebAssembly/stack-protector.ll

  Log Message:
  -----------
  [WebAssembly] Generate unreachable after __stack_chk_fail

`__stack_chk_fail` does not return, but `unreachable` was not generated
following `call __stack_chk_fail`. This had a possibility to generate an
invalid binary for functions with a return type, because
`__stack_chk_fail`'s return type is void and `call __stack_chk_fail` can
be the last instruction in the function whose return type is non-void.
Generating `unreachable` after it makes sure CFGStackify's
`fixEndsAtEndOfFunction` handles it correctly.

Reviewed By: tlively

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




More information about the All-commits mailing list