capstone-engine / capstone

Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
http://www.capstone-engine.org
7.61k stars 1.56k forks source link

HPPADisassembler.c unitialized variables #2304

Closed XVilka closed 7 months ago

XVilka commented 7 months ago

@R33v0LT take a look please:

../subprojects/capstone-next/arch/HPPA/HPPADisassembler.c:2505:2: error: variable 'sop' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
        default:
        ^~~~~~~
../subprojects/capstone-next/arch/HPPA/HPPADisassembler.c:2508:30: note: uninitialized use occurs here
        push_int_modifier(hppa_ext, sop);
                                    ^~~
../subprojects/capstone-next/arch/HPPA/HPPADisassembler.c:2486:14: note: initialize the variable 'sop' to silence this warning
        uint32_t sop;
                    ^
                     = 0
../subprojects/capstone-next/arch/HPPA/HPPADisassembler.c:2836:15: error: variable 'subop' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
                        } else if (class == 3) {
                                   ^~~~~~~~~~
../subprojects/capstone-next/arch/HPPA/HPPADisassembler.c:2846:12: note: uninitialized use occurs here
                                       subop, ud->mode);
                                       ^~~~~
../subprojects/capstone-next/arch/HPPA/HPPADisassembler.c:2836:11: note: remove the 'if' if its condition is always true
                        } else if (class == 3) {
                               ^~~~~~~~~~~~~~~~
../subprojects/capstone-next/arch/HPPA/HPPADisassembler.c:2794:16: note: initialize the variable 'subop' to silence this warning
        uint32_t subop;
                      ^
                       = 0
2 errors generated.

See https://github.com/rizinorg/rizin/actions/runs/8480023715/job/23235014043?pr=4394#step:13:748 for more details