cppcheck: fix possible null deref and unused structs
[m6w6/ext-psi] / src / libjit.c
index f99c0390f5932b54f69808aa4f21c5e4ddbe065d..23d53c16a4efe9ceb70702c1bf9634e4b36e5b1c 100644 (file)
@@ -180,10 +180,6 @@ static inline jit_type_t psi_jit_decl_arg_type(decl_arg *darg) {
 struct psi_jit_context {
        jit_context_t jit;
        jit_type_t signature;
-       struct {
-               struct psi_jit_data **list;
-               size_t count;
-       } data;
 };
 
 struct psi_jit_call {
@@ -192,12 +188,6 @@ struct psi_jit_call {
        void *params[1]; /* [type1, type2, NULL, arg1, arg2] ... */
 };
 
-struct psi_jit_data {
-       struct psi_jit_context *context;
-       impl *impl;
-       zend_internal_arg_info *arginfo;
-};
-
 static inline struct psi_jit_call *psi_jit_call_alloc(struct psi_context *C, decl *decl) {
        size_t i, c = decl->args ? decl->args->count : 0;
        struct psi_jit_call *call = calloc(1, sizeof(*call) + 2 * c * sizeof(void *));
@@ -388,12 +378,12 @@ static zend_function_entry *psi_jit_compile(struct psi_context *C)
                if (!impl->decl) {
                        continue;
                }
-
-               if ((call = psi_jit_call_alloc(C, impl->decl))) {
-                       if (!psi_jit_call_init_closure(C, call, impl)) {
-                               psi_jit_call_free(call);
-                               continue;
-                       }
+               if (!(call = psi_jit_call_alloc(C, impl->decl))) {
+                       continue;
+               }
+               if (!psi_jit_call_init_closure(C, call, impl)) {
+                       psi_jit_call_free(call);
+                       continue;
                }
 
                zf->fname = impl->func->name + (impl->func->name[0] == '\\');