For Programmers: Free Programming Magazines  


Home > Archive > PHP Zend Engine > October 2004 > cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_vm_handlers.h









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_vm_handlers.h
Marcus Boerger

2004-10-08, 8:55 pm

helly Fri Oct 8 18:17:35 2004 EDT

Modified files:
/ZendEngine2 zend_compile.c zend_compile.h zend_vm_handlers.h
Log:
- Revert automatic pass arg_info
# We need to find a better solutions to prevent havy extension writer probs


http://cvs.php.net/diff.php/ZendEng...5&r2=1.596&ty=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.595 ZendEngine2/zend_compile.c:1.596
--- ZendEngine2/zend_compile.c:1.595 Fri Oct 8 14:50:00 2004
+++ ZendEngine2/zend_compile.c Fri Oct 8 18:17:32 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: zend_compile.c,v 1.595 2004/10/08 18:50:00 andi Exp $ */
+/* $Id: zend_compile.c,v 1.596 2004/10/08 22:17:32 helly Exp $ */

#include "zend_language_parser.h"
#include "zend.h"
@@ -1454,7 +1454,7 @@
}

if (function_ptr) {
- send_by_reference = ARG_SEND_TYPE(function_ptr, (zend_uint) offset);
+ send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset) ? ZEND_ARG_SEND_BY_REF : 0;
} else {
send_by_reference = 0;
}
@@ -1466,7 +1466,7 @@
op = ZEND_SEND_VAR_NO_REF;
}

- if (op!=ZEND_SEND_VAR_NO_REF && send_by_reference!=0) {
+ if (op!=ZEND_SEND_VAR_NO_REF && send_by_reference==ZEND_ARG_SEND_BY_REF)
{
/* change to passing by reference */
switch (param->op_type) {
case IS_VAR:
@@ -1474,9 +1474,7 @@
op = ZEND_SEND_REF;
break;
default:
- if (send_by_reference==ZEND_ARG_SEND_BY_REF
) {
- zend_error(E_COMPILE_ERROR, "Only variables can be passed by reference");
- }
+ zend_error(E_COMPILE_ERROR, "Only variables can be passed by reference");
break;
}
}
http://cvs.php.net/diff.php/ZendEng...5&r2=1.296&ty=u
Index: ZendEngine2/zend_compile.h
diff -u ZendEngine2/zend_compile.h:1.295 ZendEngine2/zend_compile.h:1.296
--- ZendEngine2/zend_compile.h:1.295 Tue Oct 5 14:36:46 2004
+++ ZendEngine2/zend_compile.h Fri Oct 8 18:17:32 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: zend_compile.h,v 1.295 2004/10/05 18:36:46 helly Exp $ */
+/* $Id: zend_compile.h,v 1.296 2004/10/08 22:17:32 helly Exp $ */

#ifndef ZEND_COMPILE_H
#define ZEND_COMPILE_H
@@ -812,7 +812,6 @@

#define ZEND_ARG_SEND_BY_REF (1<<0)
#define ZEND_ARG_COMPILE_TIME_BOUND (1<<1)
-#define ZEND_ARG_SEND_AUTOMATIC (1<<2)

/* Lost In Stupid Parentheses */
#define ARG_SHOULD_BE_SENT_BY_REF(zf, arg_num) \
@@ -823,24 +822,15 @@
( \
( \
arg_num<=((zend_function *) zf)->common.num_args \
- && ((zend_function *) zf)->common.arg_info[arg_num-1].pass_by_reference == ZEND_ARG_SEND_BY_REF \
+ && ((zend_function *) zf)->common.arg_info[arg_num-1].pass_by_reference \
) \
|| ( \
arg_num>((zend_function *) zf)->common.num_args \
- && ((zend_function *) zf)->common.pass_rest_by_reference == ZEND_ARG_SEND_BY_REF \
+ && ((zend_function *) zf)->common.pass_rest_by_reference \
) \
) \
)

-#define ARG_SEND_TYPE(zf, arg_num) \
- ( \
- !zf || !((zend_function *) zf)->common.arg_info \
- ? 0 \
- : ( arg_num<=((zend_function *) zf)->common.num_args \
- ? ((zend_function *) zf)->common.arg_info[arg_num-1].pass_by_reference \
- : ((zend_function *) zf)->common.pass_rest_by_reference \
- ) \
- )

#define ZEND_RETURN_VAL 0
#define ZEND_RETURN_REF 1
http://cvs.php.net/diff.php/ZendEng...1.6&r2=1.7&ty=u
Index: ZendEngine2/zend_vm_handlers.h
diff -u ZendEngine2/zend_vm_handlers.h:1.6 ZendEngine2/zend_vm_handlers.h:1.7
--- ZendEngine2/zend_vm_handlers.h:1.6 Tue Oct 5 14:36:46 2004
+++ ZendEngine2/zend_vm_handlers.h Fri Oct 8 18:17:32 2004
@@ -2550,7 +2550,7 @@
{
zend_op *opline = EX(opline);
if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
- if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF) && !(opline->extended_value & ZEND_ARG_SEND_AUTOMATIC)) {
+ if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_
var_helper);
}
} else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com