Skip to content

Commit

Permalink
Fixed calling of original compile function (#64) (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
intuibase authored Feb 14, 2025
1 parent fd5e318 commit 3a425a3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions prod/native/extension/code/Hooking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,18 @@ static zend_op_array *elastic_compile_file(zend_file_handle *file_handle, int ty
return nullptr;
}

zend_op_array *ret = nullptr;
zend_try {
if (Hooking::getInstance().getOriginalZendCompileFile()) {
return Hooking::getInstance().getOriginalZendCompileFile()(file_handle, type);
ret = Hooking::getInstance().getOriginalZendCompileFile()(file_handle, type);
}
}
zend_catch {
ELOGF_DEBUG(ELASTICAPM_G(globals)->logger_, HOOKS, "%s: original call error", __FUNCTION__);
ret = nullptr;
}
zend_end_try();
return nullptr;
return ret;
}

void Hooking::replaceHooks(bool enableInferredSpansHooks, bool enableDepenecyAutoloaderGuard) {
Expand Down

0 comments on commit 3a425a3

Please sign in to comment.