Skip to content

Commit c652cc9

Browse files
committed
fix assembly of safe_address() for x86 and x86_64
1 parent 7549beb commit c652cc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Zend/zend_alloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,7 +2461,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
24612461
size_t res = nmemb;
24622462
unsigned long overflow = 0;
24632463

2464-
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl %1,%1"
2464+
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1"
24652465
: "=&a"(res), "=&d" (overflow)
24662466
: "%0"(res),
24672467
"rm"(size),
@@ -2489,7 +2489,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
24892489

24902490
__asm__ ("mul" LP_SUFF " %3\n\t"
24912491
"add %4,%0\n\t"
2492-
"adc %1,%1"
2492+
"adc $0,%1"
24932493
: "=&a"(res), "=&d" (overflow)
24942494
: "%0"(res),
24952495
"rm"(size),

0 commit comments

Comments
 (0)