[all-commits] [llvm/llvm-project] 21e5e1: getMainExecutable: Fix hand-rolled AT_EXECPATH for...

Ed Maste via All-commits all-commits at lists.llvm.org
Thu May 7 14:05:39 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 21e5e1724b75a4fc66ddb8b7e31b7c85b8f9c67b
      https://github.com/llvm/llvm-project/commit/21e5e1724b75a4fc66ddb8b7e31b7c85b8f9c67b
  Author: Ed Maste <emaste at FreeBSD.org>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M llvm/lib/Support/Unix/Path.inc

  Log Message:
  -----------
  getMainExecutable: Fix hand-rolled AT_EXECPATH for older FreeBSD

Once we hit AT_NULL, we need to bail out of the loop; not just the
enclosing switch.  This fixes basic usage (e.g. `cc --version`) when
AT_EXECPATH isn't present on older branches (e.g. under
emu-user-static, at the moment), where we would previously run off
the end of ::environ.

Patch By: kevans

Reviewed By: arichardson

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




More information about the All-commits mailing list