Skip to content

Commit 7546503

Browse files
committed
fix ZEND_OBSERVER_NOT_OBSERVED is 2 instead of NULL
1 parent 2a16894 commit 7546503

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

agent/php_observer.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ bool nr_php_observer_is_registered(zend_function* func) {
166166
}
167167
begin_handler = (zend_observer_fcall_begin_handler *)&ZEND_OP_ARRAY_EXTENSION((&(func)->common), zend_observer_fcall_op_array_extension);
168168
// begin_handler will be NULL if the observer hasn't been installed yet.
169-
// *begin_Handler will be NULL if the function has not yet been called.
170-
return (begin_handler && *begin_handler);
169+
// *begin_Handler will be (void*)2 if the function has not yet been called.
170+
return (begin_handler && *begin_handler != (void*)2);
171171
}
172172

173173
bool nr_php_observer_remove_begin_handler(zend_function* func, nruserfn_t* wraprec) {

0 commit comments

Comments
 (0)