cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h /tests ns_038.phpt

From: Date: Wed, 01 Aug 2007 11:44:25 +0000
Subject: cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h /tests ns_038.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5939@lists.php.net to get a copy of this message
dmitry Wed Aug 1 11:44:25 2007 UTC Added files: /ZendEngine2/tests ns_038.phpt Modified files: /ZendEngine2 zend_vm_def.h zend_vm_execute.h Log: Fixed namespace name and internal class name ambiguity

http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_def.h?r1=1.175&r2=1.176&diff_format=u Index: ZendEngine2/zend_vm_def.h diff -u ZendEngine2/zend_vm_def.h:1.175 ZendEngine2/zend_vm_def.h:1.176 --- ZendEngine2/zend_vm_def.h:1.175 Fri Jul 27 13:41:36 2007 +++ ZendEngine2/zend_vm_def.h Wed Aug 1 11:44:24 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_def.h,v 1.175 2007/07/27 13:41:36 dmitry Exp $ */ +/* $Id: zend_vm_def.h,v 1.176 2007/08/01 11:44:24 dmitry Exp $ */ /* If you change this file, please regenerate the zend_vm_execute.h and * zend_vm_opcodes.h files by running: @@ -1849,7 +1849,16 @@ } } if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) { + lcname_len -= Z_UNILEN(opline->op2.u.constant) + 2; + if (UG(unicode)) { + ns.u[lcname_len] = 0; + } else { + ns.s[lcname_len] = 0; + } ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), ns, lcname_len, opline->extended_value & ~ZEND_FETCH_CLASS_RT_NS_CHECK TSRMLS_CC); + if (!ce) { + zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); + } } else { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_execute.h?r1=1.179&r2=1.180&diff_format=u Index: ZendEngine2/zend_vm_execute.h diff -u ZendEngine2/zend_vm_execute.h:1.179 ZendEngine2/zend_vm_execute.h:1.180 --- ZendEngine2/zend_vm_execute.h:1.179 Fri Jul 27 13:41:36 2007 +++ ZendEngine2/zend_vm_execute.h Wed Aug 1 11:44:24 2007 @@ -2601,7 +2601,16 @@ } } if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) { + lcname_len -= Z_UNILEN(opline->op2.u.constant) + 2; + if (UG(unicode)) { + ns.u[lcname_len] = 0; + } else { + ns.s[lcname_len] = 0; + } ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), ns, lcname_len, opline->extended_value & ~ZEND_FETCH_CLASS_RT_NS_CHECK TSRMLS_CC); + if (!ce) { + zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); + } } else { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } @@ -3097,7 +3106,16 @@ } } if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) { + lcname_len -= Z_UNILEN(opline->op2.u.constant) + 2; + if (UG(unicode)) { + ns.u[lcname_len] = 0; + } else { + ns.s[lcname_len] = 0; + } ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), ns, lcname_len, opline->extended_value & ~ZEND_FETCH_CLASS_RT_NS_CHECK TSRMLS_CC); + if (!ce) { + zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); + } } else { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } @@ -3594,7 +3612,16 @@ } } if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) { + lcname_len -= Z_UNILEN(opline->op2.u.constant) + 2; + if (UG(unicode)) { + ns.u[lcname_len] = 0; + } else { + ns.s[lcname_len] = 0; + } ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), ns, lcname_len, opline->extended_value & ~ZEND_FETCH_CLASS_RT_NS_CHECK TSRMLS_CC); + if (!ce) { + zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); + } } else { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } @@ -3857,7 +3884,16 @@ } } if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) { + lcname_len -= Z_UNILEN(opline->op2.u.constant) + 2; + if (UG(unicode)) { + ns.u[lcname_len] = 0; + } else { + ns.s[lcname_len] = 0; + } ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), ns, lcname_len, opline->extended_value & ~ZEND_FETCH_CLASS_RT_NS_CHECK TSRMLS_CC); + if (!ce) { + zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); + } } else { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } @@ -4322,7 +4358,16 @@ } } if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) { + lcname_len -= Z_UNILEN(opline->op2.u.constant) + 2; + if (UG(unicode)) { + ns.u[lcname_len] = 0; + } else { + ns.s[lcname_len] = 0; + } ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), ns, lcname_len, opline->extended_value & ~ZEND_FETCH_CLASS_RT_NS_CHECK TSRMLS_CC); + if (!ce) { + zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); + } } else { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } @@ -10219,7 +10264,16 @@ } } if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) { + lcname_len -= Z_UNILEN(opline->op2.u.constant) + 2; + if (UG(unicode)) { + ns.u[lcname_len] = 0; + } else { + ns.s[lcname_len] = 0; + } ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), ns, lcname_len, opline->extended_value & ~ZEND_FETCH_CLASS_RT_NS_CHECK TSRMLS_CC); + if (!ce) { + zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); + } } else { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } @@ -11947,7 +12001,16 @@ } } if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) { + lcname_len -= Z_UNILEN(opline->op2.u.constant) + 2; + if (UG(unicode)) { + ns.u[lcname_len] = 0; + } else { + ns.s[lcname_len] = 0; + } ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), ns, lcname_len, opline->extended_value & ~ZEND_FETCH_CLASS_RT_NS_CHECK TSRMLS_CC); + if (!ce) { + zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); + } } else { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } @@ -13667,7 +13730,16 @@ } } if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) { + lcname_len -= Z_UNILEN(opline->op2.u.constant) + 2; + if (UG(unicode)) { + ns.u[lcname_len] = 0; + } else { + ns.s[lcname_len] = 0; + } ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), ns, lcname_len, opline->extended_value & ~ZEND_FETCH_CLASS_RT_NS_CHECK TSRMLS_CC); + if (!ce) { + zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); + } } else { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } @@ -14585,7 +14657,16 @@ } } if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) { + lcname_len -= Z_UNILEN(opline->op2.u.constant) + 2; + if (UG(unicode)) { + ns.u[lcname_len] = 0; + } else { + ns.s[lcname_len] = 0; + } ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), ns, lcname_len, opline->extended_value & ~ZEND_FETCH_CLASS_RT_NS_CHECK TSRMLS_CC); + if (!ce) { + zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); + } } else { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } @@ -15955,7 +16036,16 @@ } } if (opline->extended_value & ZEND_FETCH_CLASS_RT_NS_CHECK) { + lcname_len -= Z_UNILEN(opline->op2.u.constant) + 2; + if (UG(unicode)) { + ns.u[lcname_len] = 0; + } else { + ns.s[lcname_len] = 0; + } ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), ns, lcname_len, opline->extended_value & ~ZEND_FETCH_CLASS_RT_NS_CHECK TSRMLS_CC); + if (!ce) { + zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); + } } else { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_038.phpt?view=markup&rev=1.1 Index: ZendEngine2/tests/ns_038.phpt +++ ZendEngine2/tests/ns_038.phpt --TEST-- 038: Name ambiguity (namespace name or internal class name) --FILE-- <?php namespace Exception; function foo() { echo "ok\n"; } Exception::foo(); Exception::bar(); --EXPECTF-- ok Fatal error: Call to undefined method Exception::bar() in %sns_038.php on line 7
« previous php.zend-engine.cvs (#5939) next »