[all-commits] [llvm/llvm-project] ef7ca1: [WebAssembly] Report error for inline assembly wit...

mojingran via All-commits all-commits at lists.llvm.org
Tue Jul 11 07:27:24 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ef7ca14fa5091fc1d0b1992384bff700a2dac47d
      https://github.com/llvm/llvm-project/commit/ef7ca14fa5091fc1d0b1992384bff700a2dac47d
  Author: David Mo <david.mo1 at huawei.com>
  Date:   2023-07-11 (Tue, 11 Jul 2023)

  Changed paths:
    M llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp
    M llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp
    M llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
    A llvm/test/CodeGen/WebAssembly/inline-asm-failure.ll

  Log Message:
  -----------
  [WebAssembly] Report error for inline assembly with unsupported opcodes

For inline WebAssembly, passing a numeric operand to global.get is
unsupported. This causes encodeInstruction to reach an llvm_unreachable
call, leading to undefined behaviors. This patch fixes the issue for
this invalid instruction encoding, making it report an error by adding
an MCContext field in class WebAssemblyMCCodeEmitter.

Reviewed By: sbc100, bryanpkc

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




More information about the All-commits mailing list