]> granicus.if.org Git - php/commitdiff
- Maybe it's OK now? :)
authorAndi Gutmans <andi@php.net>
Thu, 9 Nov 2000 23:54:18 +0000 (23:54 +0000)
committerAndi Gutmans <andi@php.net>
Thu, 9 Nov 2000 23:54:18 +0000 (23:54 +0000)
Zend/zend_compile.c
Zend/zend_compile.h

index 33616a0d5af312399238ae84bcc22b8e8c799f50..9246ee3e785e54097c58ffe8bfed3664cf4cf105 100644 (file)
@@ -303,7 +303,15 @@ void zend_do_echo(znode *arg CLS_DC)
 
 void zend_do_assign(znode *result, znode *variable, znode *value CLS_DC)
 {
-       zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
+       zend_op *opline;
+
+       if (value->op_type == IS_VAR && value->u.EA.type & EXT_TYPE_NEW_OP) {
+               value->u.EA.type &= ~EXT_TYPE_NEW_OP;
+               zend_do_assign_ref(result, variable, value CLS_CC);
+               return;
+       }
+
+       opline = get_next_op(CG(active_op_array) CLS_CC);
 
        opline->opcode = ZEND_ASSIGN;
        opline->result.op_type = IS_VAR;
@@ -1649,6 +1657,7 @@ void zend_do_begin_new_object(znode *new_token, znode *class_name CLS_DC)
        opline->opcode = ZEND_NEW;
        opline->result.op_type = IS_VAR;
        opline->result.u.var = get_temporary_variable(CG(active_op_array));
+       opline->result.u.EA.type |= EXT_TYPE_NEW_OP;
        opline->op1 = *class_name;
        SET_UNUSED(opline->op2);
 
index bc771935e6ace7d72b3b295fbed070ee47976723..445d9cb0b3196ce818c62440d28c58ebab31ca8b 100644 (file)
@@ -204,6 +204,7 @@ typedef struct _zend_file_handle {
 
 
 #define EXT_TYPE_UNUSED                (1<<0)
+#define EXT_TYPE_NEW_OP                (1<<1)
 
 #include "zend_globals.h"