#define ZVAL_OFFSETOF_TYPE \
(offsetof(zval, u1.type_info) - offsetof(zval, value))
+#if defined(HAVE_ASM_GOTO) && !__has_feature(memory_sanitizer)
+# define ZEND_USE_ASM_ARITHMETIC 1
+#else
+# define ZEND_USE_ASM_ARITHMETIC 0
+#endif
+
static zend_always_inline void fast_long_increment_function(zval *op1)
{
-#if defined(HAVE_ASM_GOTO) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
+#if ZEND_USE_ASM_ARITHMETIC && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
__asm__ goto(
"addl $1,(%0)\n\t"
"jo %l1\n"
return;
overflow: ZEND_ATTRIBUTE_COLD_LABEL
ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0);
-#elif defined(HAVE_ASM_GOTO) && defined(__x86_64__)
+#elif ZEND_USE_ASM_ARITHMETIC && defined(__x86_64__)
__asm__ goto(
"addq $1,(%0)\n\t"
"jo %l1\n"
return;
overflow: ZEND_ATTRIBUTE_COLD_LABEL
ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0);
-#elif defined(HAVE_ASM_GOTO) && defined(__aarch64__)
+#elif ZEND_USE_ASM_ARITHMETIC && defined(__aarch64__)
__asm__ goto (
"ldr x5, [%0]\n\t"
"adds x5, x5, 1\n\t"
static zend_always_inline void fast_long_decrement_function(zval *op1)
{
-#if defined(HAVE_ASM_GOTO) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
+#if ZEND_USE_ASM_ARITHMETIC && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
__asm__ goto(
"subl $1,(%0)\n\t"
"jo %l1\n"
return;
overflow: ZEND_ATTRIBUTE_COLD_LABEL
ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0);
-#elif defined(HAVE_ASM_GOTO) && defined(__x86_64__)
+#elif ZEND_USE_ASM_ARITHMETIC && defined(__x86_64__)
__asm__ goto(
"subq $1,(%0)\n\t"
"jo %l1\n"
return;
overflow: ZEND_ATTRIBUTE_COLD_LABEL
ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0);
-#elif defined(HAVE_ASM_GOTO) && defined(__aarch64__)
+#elif ZEND_USE_ASM_ARITHMETIC && defined(__aarch64__)
__asm__ goto (
"ldr x5, [%0]\n\t"
"subs x5 ,x5, 1\n\t"
static zend_always_inline void fast_long_add_function(zval *result, zval *op1, zval *op2)
{
-#if defined(HAVE_ASM_GOTO) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
+#if ZEND_USE_ASM_ARITHMETIC && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
__asm__ goto(
"movl (%1), %%eax\n\t"
"addl (%2), %%eax\n\t"
return;
overflow: ZEND_ATTRIBUTE_COLD_LABEL
ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2));
-#elif defined(HAVE_ASM_GOTO) && defined(__x86_64__)
+#elif ZEND_USE_ASM_ARITHMETIC && defined(__x86_64__)
__asm__ goto(
"movq (%1), %%rax\n\t"
"addq (%2), %%rax\n\t"
return;
overflow: ZEND_ATTRIBUTE_COLD_LABEL
ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2));
-#elif defined(HAVE_ASM_GOTO) && defined(__aarch64__)
+#elif ZEND_USE_ASM_ARITHMETIC && defined(__aarch64__)
__asm__ goto(
"ldr x5, [%1]\n\t"
"ldr x6, [%2]\n\t"
static zend_always_inline void fast_long_sub_function(zval *result, zval *op1, zval *op2)
{
-#if defined(HAVE_ASM_GOTO) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
+#if ZEND_USE_ASM_ARITHMETIC && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
__asm__ goto(
"movl (%1), %%eax\n\t"
"subl (%2), %%eax\n\t"
return;
overflow: ZEND_ATTRIBUTE_COLD_LABEL
ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2));
-#elif defined(HAVE_ASM_GOTO) && defined(__x86_64__)
+#elif ZEND_USE_ASM_ARITHMETIC && defined(__x86_64__)
__asm__ goto(
"movq (%1), %%rax\n\t"
"subq (%2), %%rax\n\t"
return;
overflow: ZEND_ATTRIBUTE_COLD_LABEL
ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2));
-#elif defined(HAVE_ASM_GOTO) && defined(__aarch64__)
+#elif ZEND_USE_ASM_ARITHMETIC && defined(__aarch64__)
__asm__ goto(
"ldr x5, [%1]\n\t"
"ldr x6, [%2]\n\t"