summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2013-04-25 12:53:02 +0200
committerOndřej Surý <ondrej@sury.org>2013-04-25 12:53:02 +0200
commit367111123281ebfd2876d4c8cf33414b394f489a (patch)
tree9e9d69d988b632304f51746d89c1eb3e0a178257 /Zend
parent5a7c0b1f326279a6d7dba8285e81860e1f0ff8ce (diff)
downloadphp-367111123281ebfd2876d4c8cf33414b394f489a.tar.gz
Imported Upstream version 5.5.0~beta4upstream/5.5.0_beta4
Diffstat (limited to 'Zend')
-rw-r--r--Zend/tests/bug52041.phpt12
-rw-r--r--Zend/tests/bug60536_001.phpt2
-rw-r--r--Zend/tests/bug62005.phpt2
-rw-r--r--Zend/tests/bug64677.phpt21
-rw-r--r--Zend/zend_compile.c1
-rw-r--r--Zend/zend_generators.h4
-rw-r--r--Zend/zend_object_handlers.c2
-rw-r--r--Zend/zend_vm_def.h6
-rw-r--r--Zend/zend_vm_execute.h10
9 files changed, 45 insertions, 15 deletions
diff --git a/Zend/tests/bug52041.phpt b/Zend/tests/bug52041.phpt
index 96ddaa1c6..7e1f3423a 100644
--- a/Zend/tests/bug52041.phpt
+++ b/Zend/tests/bug52041.phpt
@@ -35,29 +35,29 @@ Notice: Undefined variable: x in %sbug52041.php on line 3
Warning: Creating default object from empty value in %sbug52041.php on line 8
-Notice: Undefined property: a in %sbug52041.php on line 8
+Notice: Undefined property: stdClass::$a in %sbug52041.php on line 8
Notice: Undefined variable: x in %sbug52041.php on line 3
-Notice: Undefined property: a in %sbug52041.php on line 9
+Notice: Undefined property: stdClass::$a in %sbug52041.php on line 9
Warning: Creating default object from empty value in %sbug52041.php on line 9
-Notice: Undefined property: b in %sbug52041.php on line 9
+Notice: Undefined property: stdClass::$b in %sbug52041.php on line 9
Notice: Undefined variable: x in %sbug52041.php on line 3
Warning: Creating default object from empty value in %sbug52041.php on line 10
-Notice: Undefined property: a in %sbug52041.php on line 10
+Notice: Undefined property: stdClass::$a in %sbug52041.php on line 10
Notice: Undefined variable: x in %sbug52041.php on line 3
-Notice: Undefined property: a in %sbug52041.php on line 11
+Notice: Undefined property: stdClass::$a in %sbug52041.php on line 11
Warning: Creating default object from empty value in %sbug52041.php on line 11
-Notice: Undefined property: b in %sbug52041.php on line 11
+Notice: Undefined property: stdClass::$b in %sbug52041.php on line 11
Notice: Undefined variable: x in %sbug52041.php on line 3
diff --git a/Zend/tests/bug60536_001.phpt b/Zend/tests/bug60536_001.phpt
index 418b986fc..a94e21ece 100644
--- a/Zend/tests/bug60536_001.phpt
+++ b/Zend/tests/bug60536_001.phpt
@@ -23,5 +23,5 @@ echo "DONE";
?>
--EXPECTF--
-Notice: Undefined property: x in %s on line 14
+Notice: Undefined property: Z::$x in %s on line 14
DONE
diff --git a/Zend/tests/bug62005.phpt b/Zend/tests/bug62005.phpt
index 2f83412b5..83158d5cc 100644
--- a/Zend/tests/bug62005.phpt
+++ b/Zend/tests/bug62005.phpt
@@ -10,7 +10,7 @@ add_points(NULL, 2);
--EXPECTF--
Warning: Creating default object from empty value in %sbug62005.php on line %d
-Notice: Undefined property: energy in %sbug62005.php on line 3
+Notice: Undefined property: stdClass::$energy in %sbug62005.php on line 3
stdClass Object
(
[energy] => 2
diff --git a/Zend/tests/bug64677.phpt b/Zend/tests/bug64677.phpt
new file mode 100644
index 000000000..44a7c5fc6
--- /dev/null
+++ b/Zend/tests/bug64677.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #64677 (execution operator `` stealing surrounding arguments)
+--FILE--
+<?PHP
+class cat {
+ public function show_output($prepend, $output = '') {
+ }
+}
+$cat = new cat();
+$cat->show_output('Files: ', trim(`cd .`)); // this gives invalid args to shell_exec
+$cat->show_output('Files: ', `cd .`); // this causes a segmentation fault
+$cat->show_output(`cd .`); // this causes a segmentation fault
+
+function show_outputa($prepend, $output) {
+ echo "Okey";
+}
+show_outputa('Files: ', `cd .`); // this works as expected
+
+?>
+--EXPECT--
+Okey
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 768079091..3c0d753b6 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -5702,6 +5702,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC) /* {{{ */
GET_CACHE_SLOT(opline->op1.constant);
opline->extended_value = 1;
SET_UNUSED(opline->op2);
+ opline->op2.num = CG(context).nested_calls;
GET_NODE(result, opline->result);
if (CG(context).nested_calls + 1 > CG(active_op_array)->nested_calls) {
diff --git a/Zend/zend_generators.h b/Zend/zend_generators.h
index 9f37b93c4..bc125658e 100644
--- a/Zend/zend_generators.h
+++ b/Zend/zend_generators.h
@@ -22,8 +22,8 @@
#define ZEND_GENERATORS_H
BEGIN_EXTERN_C()
+
extern ZEND_API zend_class_entry *zend_ce_generator;
-END_EXTERN_C()
typedef struct _zend_generator_iterator {
zend_object_iterator intern;
@@ -66,6 +66,8 @@ ZEND_API zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC);
ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution TSRMLS_DC);
ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC);
+END_EXTERN_C()
+
#endif
/*
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 54140b87c..92c67c343 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -755,7 +755,7 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type
new_zval = &EG(uninitialized_zval);
if(UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
- zend_error(E_NOTICE, "Undefined property: %s", Z_STRVAL_P(member));
+ zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member));
}
Z_ADDREF_P(new_zval);
if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 7371d0e44..386641a62 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -3168,7 +3168,9 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
ZEND_VM_NEXT_OPCODE();
}
- if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
+ if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
+ EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
+ !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
}
@@ -4939,7 +4941,7 @@ ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, CONST)
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
- CACHE_PTR(opline->op2.literal->cache_slot, ce);
+ CACHE_PTR(opline->op2.literal->cache_slot, iface);
}
if (UNEXPECTED((iface->ce_flags & ZEND_ACC_INTERFACE) == 0)) {
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 8703dec22..916a6ffe5 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -1479,7 +1479,7 @@ static int ZEND_FASTCALL ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
- CACHE_PTR(opline->op2.literal->cache_slot, ce);
+ CACHE_PTR(opline->op2.literal->cache_slot, iface);
}
if (UNEXPECTED((iface->ce_flags & ZEND_ACC_INTERFACE) == 0)) {
@@ -13089,7 +13089,9 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZEND_VM_NEXT_OPCODE();
}
- if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
+ if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
+ EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
+ !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -30710,7 +30712,9 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZEND_VM_NEXT_OPCODE();
}
- if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
+ if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
+ EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
+ !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}