]> granicus.if.org Git - php/commitdiff
Don't swap operands of ZEND_MUL
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 8 Jan 2019 08:36:48 +0000 (09:36 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 8 Jan 2019 08:37:49 +0000 (09:37 +0100)
If this is used with operator overloading, then the operation does
not necessarily commute (for example, matrix multiplication).

ext/opcache/Optimizer/pass3.c

index fc2cae10d8d705168136e035c5c09226cab72681..fecadbcec587c1d0543e7e60edfe4fa88cb066e1 100644 (file)
@@ -93,7 +93,6 @@ void zend_optimizer_pass3(zend_op_array *op_array)
                                        if ((opline->op2_type & (IS_VAR | IS_CV))
                                                && opline->op2.var == next_opline->op1.var &&
                                                (opline->opcode == ZEND_ADD ||
-                                                opline->opcode == ZEND_MUL ||
                                                 opline->opcode == ZEND_BW_OR ||
                                                 opline->opcode == ZEND_BW_AND ||
                                                 opline->opcode == ZEND_BW_XOR)) {