Skip to content

Commit

Permalink
fix ZEND_OBSERVER_NOT_OBSERVED is 2 instead of NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
ZNeumann committed Aug 8, 2024
1 parent 2a16894 commit 7546503
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions agent/php_observer.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ bool nr_php_observer_is_registered(zend_function* func) {
}
begin_handler = (zend_observer_fcall_begin_handler *)&ZEND_OP_ARRAY_EXTENSION((&(func)->common), zend_observer_fcall_op_array_extension);
// begin_handler will be NULL if the observer hasn't been installed yet.
// *begin_Handler will be NULL if the function has not yet been called.
return (begin_handler && *begin_handler);
// *begin_Handler will be (void*)2 if the function has not yet been called.
return (begin_handler && *begin_handler != (void*)2);
}

bool nr_php_observer_remove_begin_handler(zend_function* func, nruserfn_t* wraprec) {
Expand Down

0 comments on commit 7546503

Please sign in to comment.