From 75465031f38be6fad36929e0ebe5b56826ffa6df Mon Sep 17 00:00:00 2001 From: Zach Neumann Date: Thu, 8 Aug 2024 11:30:10 -0600 Subject: [PATCH] fix ZEND_OBSERVER_NOT_OBSERVED is 2 instead of NULL --- agent/php_observer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/php_observer.c b/agent/php_observer.c index 9a60eea86..019063cb7 100644 --- a/agent/php_observer.c +++ b/agent/php_observer.c @@ -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) {