« Previous | Next » 

Revision b6d9766d

IDb6d9766ddf5453e79e0c66c9348728ba44ba115f

Added by Jia Liu over 10 years ago

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 <>
Reviewed-by: Jia Liu <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences