[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abo
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort() |
Date: |
Mon, 15 Mar 2010 19:28:28 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Paolo Bonzini <address@hidden> writes:
>>>> I sympathize with the general idea, but I don't like dead code
>>> after abort(). What about cleaning that up?
>>>
>> Good idea, but it should be a separate patch. This patch is "safe",
>> whereas the cleanup patch could cause problems if it's not done
>> carefully.
>
> This patch is "safe", however I'd consider not changing
> assert(0)->abort() if there is code after the assert that looks like
> an attempt at recovering. Example:
>
> if (!p) {
> printf ("the impossible has happened!");
> assert (0);
> }
>
> return p->q;
>
> should be changed to abort, while
>
> if (!p) {
> printf ("the impossible has happened!");
> assert (0);
> return 0;
> }
>
> return p->q;
>
> should not.
Except when you find that the recovery attempt is insufficient, of
course. Requires closer inspection.
- [Qemu-devel] [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Blue Swirl, 2010/03/13
- Re: [Qemu-devel] [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Edgar E. Iglesias, 2010/03/13
- Re: [Qemu-devel] [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Markus Armbruster, 2010/03/15
- Re: [Qemu-devel] [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Blue Swirl, 2010/03/15
- [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Paolo Bonzini, 2010/03/15
- [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Blue Swirl, 2010/03/15
- [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Paolo Bonzini, 2010/03/15
- [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Blue Swirl, 2010/03/15
- [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(),
Markus Armbruster <=
- Re: [Qemu-devel] [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Markus Armbruster, 2010/03/15
- [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Paolo Bonzini, 2010/03/16
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Markus Armbruster, 2010/03/16
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Jamie Lokier, 2010/03/16
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Paolo Bonzini, 2010/03/17
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Blue Swirl, 2010/03/17
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Jamie Lokier, 2010/03/18
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Blue Swirl, 2010/03/19
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Markus Armbruster, 2010/03/18
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Jamie Lokier, 2010/03/16