1
0
mirror of https://github.com/php/php-src.git synced 2026-04-09 00:53:30 +02:00

fix assembly of safe_address() for x86 and x86_64

This commit is contained in:
Nuno Lopes
2013-07-03 17:53:46 -04:00
parent 332e46b3aa
commit 40cbceaf71

View File

@@ -2465,7 +2465,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
size_t res = nmemb;
unsigned long overflow = 0;
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl %1,%1"
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1"
: "=&a"(res), "=&d" (overflow)
: "%0"(res),
"rm"(size),
@@ -2493,7 +2493,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
__asm__ ("mul" LP_SUFF " %3\n\t"
"add %4,%0\n\t"
"adc %1,%1"
"adc $0,%1"
: "=&a"(res), "=&d" (overflow)
: "%0"(res),
"rm"(size),