Skip to content

Commit 2a3dae1

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 14b0862 + 0d9f3a5 commit 2a3dae1

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Zend/zend_operators.h

+14-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,20 @@
2828
#include <stdint.h>
2929

3030
#ifdef HAVE_IEEEFP_H
31-
#include <ieeefp.h>
31+
/**
32+
* On FreeBSD with ubsan/clang we get the following:
33+
* `/usr/include/machine/ieeefp.h:161:17: runtime error: left shift of negative value -1`
34+
* `SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/include/machine/ieeefp.h:161:17`
35+
* ...
36+
* `_newcw |= (~_m << FP_MSKS_OFF) & FP_MSKS_FLD;`
37+
**/
38+
# if __has_feature(undefined_behavior_sanitizer) && defined(__FreeBSD__) && defined(__clang__)
39+
# pragma clang attribute push (__attribute__((no_sanitize("undefined"))), apply_to=function)
40+
# endif
41+
# include <ieeefp.h>
42+
# if __has_feature(undefined_behavior_sanitizer) && defined(__FreeBSD__) && defined(__clang__)
43+
# pragma clang attribute pop
44+
# endif
3245
#endif
3346

3447
#include "zend_portability.h"

0 commit comments

Comments
 (0)