HomePhabricator

getMainExecutable: Fix hand-rolled AT_EXECPATH for older FreeBSD

Authored by emaste on Thu, May 7, 11:57 AM.

Description

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

Details