[all-commits] [llvm/llvm-project] df08b2: [AArch64] Avoid crashing on invalid -Wa, -march= va...

Dimitry Andric via All-commits all-commits at lists.llvm.org
Sun Nov 28 13:24:07 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: df08b2fe8b35cb63dfb3b49738a3494b9b4e6f8e
      https://github.com/llvm/llvm-project/commit/df08b2fe8b35cb63dfb3b49738a3494b9b4e6f8e
  Author: Dimitry Andric <dimitry at andric.com>
  Date:   2021-11-28 (Sun, 28 Nov 2021)

  Changed paths:
    M clang/lib/Driver/ToolChains/Arch/AArch64.cpp
    M clang/test/Driver/aarch64-target-as-march.s

  Log Message:
  -----------
  [AArch64] Avoid crashing on invalid -Wa,-march= values

As reported in https://bugs.freebsd.org/260078, the gnutls Makefiles
pass -Wa,-march=all to compile a number of assembly files. Clang does
not support this -march value, but because of a mistake in handling
the arguments, an unitialized Arg pointer is dereferenced, which can
cause a segfault.

Work around this by adding a check if the local WaMArch variable is
initialized, and if so, using its value in the diagnostic message.

Reviewed By: tschuett

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




More information about the All-commits mailing list