Skip to content

Commit 39d8fc1

Browse files
committed
Changed PowerPC CPU registers used by Zend VM to work around GCC bug.
Old registers (r28/r29) might be clobbered by _restgpr routine used for return from C function compiled with -Os.
1 parent 206fd35 commit 39d8fc1

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 2021, PHP 7.4.18
44

5+
- Core:
6+
. Changed PowerPC CPU registers used by Zend VM to work around GCC bug.
7+
Old registers (r28/r29) might be clobbered by _restgpr routine used for
8+
return from C function compiled with -Os. (Dmitry)
9+
510
- DOM:
611
. Fixed bug #66783 (UAF when appending DOMDocument to element). (cmb)
712

Zend/zend_execute.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@
5151
# define ZEND_VM_FP_GLOBAL_REG "%r14"
5252
# define ZEND_VM_IP_GLOBAL_REG "%r15"
5353
# elif defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(__powerpc64__)
54-
# define ZEND_VM_FP_GLOBAL_REG "r28"
55-
# define ZEND_VM_IP_GLOBAL_REG "r29"
54+
# define ZEND_VM_FP_GLOBAL_REG "r14"
55+
# define ZEND_VM_IP_GLOBAL_REG "r15"
5656
# elif defined(__IBMC__) && ZEND_GCC_VERSION >= 4002 && defined(__powerpc64__)
57-
# define ZEND_VM_FP_GLOBAL_REG "r28"
58-
# define ZEND_VM_IP_GLOBAL_REG "r29"
57+
# define ZEND_VM_FP_GLOBAL_REG "r14"
58+
# define ZEND_VM_IP_GLOBAL_REG "r15"
5959
# elif defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(__aarch64__)
6060
# define ZEND_VM_FP_GLOBAL_REG "x27"
6161
# define ZEND_VM_IP_GLOBAL_REG "x28"

0 commit comments

Comments
 (0)