Skip to content

Commit 5131a2d

Browse files
lavarouzsistla
andauthored
use NR_OP_ARRAY macro when accessing &execute_data->func->op_array
Co-authored-by: Amber Sistla <[email protected]>
1 parent 9d261da commit 5131a2d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

agent/php_observer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static zend_observer_fcall_handlers nr_php_fcall_register_handlers(
9898
return handlers;
9999
}
100100

101-
if (OP_ARRAY_IS_A_METHOD(&execute_data->func->op_array)) {
101+
if (OP_ARRAY_IS_A_METHOD(NR_OP_ARRAY)) {
102102
scope_name = execute_data->func->op_array.scope->name;
103103
func_name = execute_data->func->op_array.function_name;
104104
#if 0
@@ -108,21 +108,21 @@ static zend_observer_fcall_handlers nr_php_fcall_register_handlers(
108108
ZSTR_VAL(scope_name), scope_name->h, cn_hash,
109109
ZSTR_VAL(func_name), func_name->h, fn_hash);
110110
#endif
111-
} else if (OP_ARRAY_IS_A_FUNCTION(&execute_data->func->op_array)){
111+
} else if (OP_ARRAY_IS_A_FUNCTION(NR_OP_ARRAY)){
112112
func_name = execute_data->func->op_array.function_name;
113113
#if 0
114114
zend_long fn_hash = zend_hash_func(ZSTR_VAL(func_name), ZSTR_LEN(func_name));
115115
nrl_always("function_name=%s, function_name->h=%zu, fn_hash=%zu", ZSTR_VAL(func_name), func_name->h, fn_hash);
116116
#endif
117117
}
118118

119-
if (!ZEND_OP_ARRAY_EXTENSION(&execute_data->func->op_array, NR_PHP_PROCESS_GLOBALS(op_array_extension_handle))) {
119+
if (!ZEND_OP_ARRAY_EXTENSION(NR_OP_ARRAY, NR_PHP_PROCESS_GLOBALS(op_array_extension_handle))) {
120120
// nrl_always("wraprec not installed yet");
121121
wr = nr_php_user_instrument_wraprec_hashmap_get(func_name, scope_name);
122122
// nrl_always("found wraprec=%p", wr);
123123

124124
// store the wraprec in the op_array extension for the duration of the request for later lookup
125-
ZEND_OP_ARRAY_EXTENSION(&execute_data->func->op_array, NR_PHP_PROCESS_GLOBALS(op_array_extension_handle)) = wr;
125+
ZEND_OP_ARRAY_EXTENSION(NR_OP_ARRAY, NR_PHP_PROCESS_GLOBALS(op_array_extension_handle)) = wr;
126126
}
127127
// else {
128128
// nrl_always("wraprec already installed");

0 commit comments

Comments
 (0)