Open yogeshpandey009 opened 8 years ago
Workaround: comment out _zval_ptrdtor(&obj->value) insde aop.c:get_aopJoinpoint()
if (Z_REFCOUNT_P(aop_object) == 1) {
AopJoinpoint_object *obj = (AopJoinpoint_object *)zend_object_store_get_object(aop_object TSRMLS_CC);
if (obj->value) {
zval_ptr_dtor(&obj->value); // is causing ((zval**)ex->function_state.arguments)[-1] value corruption
}
@Juliens : Could you please share some proper fix for this issue. Thanks!
Commenting out this line doesn't fix the issue.
Warning: array_push(): could not obtain parameters for parsing in /home/juliens/devext/c/AOP/tests/issues/array_push_around.php on line 5
The problem seems to be elsewhere.
Oh sorry I forgot to mention. This fixes "before" pointcut for multiple executions of array_push()
<?php
aop_add_before('array_push()', 'beforeSystemCall');
function beforeSystemCall (AopJoinPoint $joinpoint) {
echo "Called before invoking -> {$joinpoint->getFunctionName()} with args: ", print_r($joinpoint->getArguments(), true);
}
$a = array();
array_push($a, "apple");
array_push($a, "banana");
array_push($a, "mango");
print_r($a);
Same error for mysql_query() $ php -v PHP 5.4.14 (cli) (built: Jun 27 2016 14:02:51) (DEBUG) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies