[Bug 227723] clang 6.0 breaks php56/opcache

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Apr 24 20:24:03 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227723

--- Comment #6 from Dimitry Andric <dim at FreeBSD.org> ---
After some bisecting, it turns out this behavior changed due to the following
upstream commit: https://reviews.llvm.org/rL313784 ("Remove offset size check
in nullptr arithmetic handling") and https://reviews.llvm.org/rL313666 ("Teach
clang to tolerate the 'p = nullptr + n' idiom used by glibc").

See also https://reviews.llvm.org/D37042.

What PHP5 is doing is, strictly speaking, undefined behavior, as adding numbers
to null pointers is normally not allowed.  In the upstream commit, Andrew
Kaylor has apparently tried to make this work, at least partially, for a few
specific cases used in glibc.

PHP7 and later use a completely different way of storing these variable/number
hybrids, which is not affected by this, as it apparently avoids any null
pointer arithmetic.

I'll see if I can get some feedback from Andrew on this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the freebsd-toolchain mailing list