Skip to content
Snippets Groups Projects
Commit aef70a1f authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Daniel Borkmann
Browse files

libbpf: fix false uninitialized variable warning


Some compilers emit warning for potential uninitialized next_id usage.
The code is correct, but control flow is too complicated for some
compilers to figure this out. Re-initialize next_id to satisfy
compiler.

Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent fcd30ae0
No related branches found
No related tags found
No related merge requests found
...@@ -1167,6 +1167,7 @@ static void btf_dump_emit_type_chain(struct btf_dump *d, ...@@ -1167,6 +1167,7 @@ static void btf_dump_emit_type_chain(struct btf_dump *d,
return; return;
} }
next_id = decls->ids[decls->cnt - 1];
next_t = btf__type_by_id(d->btf, next_id); next_t = btf__type_by_id(d->btf, next_id);
multidim = btf_is_array(next_t); multidim = btf_is_array(next_t);
/* we need space if we have named non-pointer */ /* we need space if we have named non-pointer */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment