target/ppc: check tb_env != 0 before printing TBU/TBL/DECR
commit3778aa970f21b475ca16befcf271078602104fe6
authorMatheus Ferst <matheus.ferst@eldorado.org.br>
Thu, 14 Jul 2022 17:23:43 +0000 (14 14:23 -0300)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Mon, 18 Jul 2022 16:59:43 +0000 (18 13:59 -0300)
treee4fadc5313d4d2b030495b12f9b05531e2fc34ee
parent491a25535c99b838772ff961a39762333f0e852f
target/ppc: check tb_env != 0 before printing TBU/TBL/DECR

When using "-machine none", env->tb_env is not allocated, causing the
segmentation fault reported in issue #85 (launchpad bug #811683). To
avoid this problem, check if the pointer != NULL before calling the
methods to print TBU/TBL/DECR.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/85
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220714172343.80539-1-matheus.ferst@eldorado.org.br>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
target/ppc/cpu_init.c
target/ppc/monitor.c