On 14 May 2012 15:46, Fabien Chouteau <chout...@adacore.com> wrote:
> Quit if no log file is defined.
>
> Signed-off-by: Fabien Chouteau <chout...@adacore.com>
> ---
>  target-ppc/translate.c |    4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/target-ppc/translate.c b/target-ppc/translate.c
> index cf59765..f17bd91 100644
> --- a/target-ppc/translate.c
> +++ b/target-ppc/translate.c
> @@ -9319,6 +9319,10 @@ void cpu_dump_state (CPUPPCState *env, FILE *f, 
> fprintf_function cpu_fprintf,
>
>     int i;
>
> +    if (f == NULL) {
> +        return;
> +    }
> +
>     cpu_synchronize_state(env);
>
>     cpu_fprintf(f, "NIP " TARGET_FMT_lx "   LR " TARGET_FMT_lx " CTR "

target-ppc isn't the only one that doesn't check for a NULL f:
perhaps it would be better to say "you can't call this with a
NULL FILE*" and fix whatever is calling it in that way?

-- PMM

Reply via email to