Skip to content

Commit 01dfb80

Browse files
committed
Define HAVE_PRESERVE_NONE only on x86_64 and aarch64, as it is ignored on other archs
1 parent fe4dc7d commit 01dfb80

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Zend/zend_portability.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,8 @@ char *alloca();
318318
# define ZEND_FASTCALL
319319
#endif
320320

321-
#if __has_attribute(preserve_none) && !defined(__SANITIZE_ADDRESS__)
321+
/* Compilers may report to have preserve_none, but support it only on some architectures */
322+
#if __has_attribute(preserve_none) && (defined(_M_X64) || defined(__x86_64__) || defined(_M_ARM64) || defined(__aarch64__))
322323
# define HAVE_PRESERVE_NONE
323324
# define ZEND_PRESERVE_NONE __attribute__((preserve_none))
324325
#else

ext/opcache/jit/ir/ir_x86.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ enum _ir_reg {
178178
| IR_REGSET(IR_REG_RBP) \
179179
| IR_REGSET_INTERVAL(IR_REG_R12, IR_REG_R15))
180180

181-
# if __has_attribute(preserve_none) && !defined(__SANITIZE_ADDRESS__)
181+
# if __has_attribute(preserve_none)
182182

183183
# define IR_HAVE_PRESERVE_NONE 1
184184

0 commit comments

Comments
 (0)