Skip to content

Conversation

@GiuseppeCesarano
Copy link

While building the library, clang rightly reports a small edge case where the ins variable is read without previous initialization :

[67/143] Compiling C object gum/libfrida-gum-1.0.a.p/backend-linux_gumprocess-linux.c.o
../gum/backend-linux/gumprocess-linux.c:3664:7: warning: variable 'insn' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
 3664 |   if (!created_thread)
      |       ^~~~~~~~~~~~~~~
../gum/backend-linux/gumprocess-linux.c:3710:7: note: uninitialized use occurs here
 3710 |   if (insn != NULL)
      |       ^~~~
../gum/backend-linux/gumprocess-linux.c:3664:3: note: remove the 'if' if its condition is always false
 3664 |   if (!created_thread)
      |   ^~~~~~~~~~~~~~~~~~~~
 3665 |     goto beach;
      |     ~~~~~~~~~~
../gum/backend-linux/gumprocess-linux.c:3658:17: note: initialize the variable 'insn' to silence this warning
 3658 |   cs_insn * insn;
      |                 ^
      |                  = NULL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant