Skip to content

Commit

Permalink
fix(*) address minor issues reported by newer clang-analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
casimiro committed Sep 12, 2023
1 parent 0458799 commit 24bf8d7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/wasm/ngx_wasm_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ ngx_wasm_ops_plan_load(ngx_wasm_ops_plan_t *plan, ngx_log_t *log)
ngx_uint_t *fid;
ngx_array_t *ids;
ngx_wasm_op_t *op;
ngx_wasm_ops_pipeline_t *pipeline;
ngx_wasm_ops_pipeline_t *pipeline = NULL;

dd("enter");

Expand Down
4 changes: 4 additions & 0 deletions src/wasm/wrt/ngx_wrt_v8.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ ngx_v8_init_instance(ngx_wrt_instance_t *instance, ngx_wrt_store_t *store,
ngx_wrt_module_t *module, ngx_pool_t *pool, ngx_wrt_err_t *err)
{
size_t i;
#if (NGX_DEBUG)
ngx_uint_t nimports = 0;
#endif
ngx_wavm_hfunc_t *import;
ngx_v8_hfunc_ctx_t *hctx = NULL;
wasm_func_t *func;
Expand Down Expand Up @@ -485,7 +487,9 @@ ngx_v8_init_instance(ngx_wrt_instance_t *instance, ngx_wrt_store_t *store,
hctx, NULL);

instance->imports[i] = wasm_func_as_extern(func);
#if (NGX_DEBUG)
nimports++;
#endif
}

ngx_wasm_assert(nimports == module->nimports);
Expand Down
6 changes: 6 additions & 0 deletions src/wasm/wrt/ngx_wrt_wasmer.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,9 @@ ngx_wasmer_init_instance(ngx_wrt_instance_t *instance, ngx_wrt_store_t *store,
ngx_wrt_module_t *module, ngx_pool_t *pool, ngx_wrt_err_t *err)
{
size_t i, j;
#if (NGX_DEBUG)
ngx_uint_t nimports = 0;
#endif
ngx_wrt_import_t *import;
ngx_wasmer_hfunc_ctx_t *hctx, *hctxs = NULL;
wasm_func_t *func;
Expand Down Expand Up @@ -558,7 +560,9 @@ ngx_wasmer_init_instance(ngx_wrt_instance_t *instance, ngx_wrt_store_t *store,
instance->env.data[i] = (wasm_extern_t *)
wasmer_named_extern_unwrap(
instance->wasi_imports.data[j]);
#if (NGX_DEBUG)
nimports++;
#endif
break;
}
}
Expand All @@ -576,7 +580,9 @@ ngx_wasmer_init_instance(ngx_wrt_instance_t *instance, ngx_wrt_store_t *store,
hctx, NULL);

instance->env.data[i] = wasm_func_as_extern(func);
#if (NGX_DEBUG)
nimports++;
#endif
break;

default:
Expand Down

0 comments on commit 24bf8d7

Please sign in to comment.