[all-commits] [llvm/llvm-project] b65267: [AsmWriter] Ensure getMnemonic doesn't return inva...

Lucas Duarte Prates via All-commits all-commits at lists.llvm.org
Wed Dec 20 02:09:42 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b652674dd0252b09a3101d8f7a2a4fc73675ac8d
      https://github.com/llvm/llvm-project/commit/b652674dd0252b09a3101d8f7a2a4fc73675ac8d
  Author: Lucas Duarte Prates <lucas.prates at arm.com>
  Date:   2023-12-20 (Wed, 20 Dec 2023)

  Changed paths:
    M llvm/lib/MC/MCAsmStreamer.cpp
    M llvm/utils/TableGen/AsmWriterEmitter.cpp

  Log Message:
  -----------
  [AsmWriter] Ensure getMnemonic doesn't return invalid pointers (#75783)

For instructions that don't map to a mnemonic string, the implementation
of MCInstPrinter::getMnemonic would return an invalid pointer due to the
result of the calculation of the instruction's position in the `AsmStrs`
table. This patch fixes the issue by ensuring those cases return a
`nullptr` value instead.

Fixes #74177.




More information about the All-commits mailing list