qemu-e2k/hw/openrisc
Jia Liu b6d9766ddf hw/openrisc: Avoid using uninitialised variable 'entry'
clang warns that cpu_openrisc_load_kernel() can use 'entry' uninitialized:

hw/openrisc/openrisc_sim.c:69:9: error: variable 'entry' is used uninitialized
whenever '&&' condition is false [-Werror,-Wsometimes-uninitialized]

    if (kernel_filename && !qtest_enabled()) {
        ^~~~~~~~~~~~~~~
hw/openrisc/openrisc_sim.c:91:19: note: uninitialized use occurs here
    cpu->env.pc = entry;
                  ^~~~~

Fix this by not attempting to change the CPU's starting PC unless
we actually loaded a kernel.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Jia Liu <proljc@gmail.com>
2013-08-21 09:15:36 +08:00
..
Makefile.objs hw: move boards and other isolated files to hw/ARCH 2013-03-01 15:01:19 +01:00
cputimer.c cpu: Move halted and interrupt_request fields to CPUState 2013-03-12 10:35:55 +01:00
openrisc_sim.c hw/openrisc: Avoid using uninitialised variable 'entry' 2013-08-21 09:15:36 +08:00
pic_cpu.c cpu: Pass CPUState to cpu_interrupt() 2013-03-12 10:35:55 +01:00