frame.c: Fix the check for FID_STACK_INVALID in frame_id_eq().

Message ID 1416944088-8750-1-git-send-email-martin.galvan@tallertechnologies.com
State New, archived
Headers

Commit Message

Martin Galvan Nov. 25, 2014, 7:34 p.m. UTC
  I noticed in frame_id_eq() we were checking for the "l" frame_id being invalid twice instead of checking both "l" and "r", so I corrected it.

gdb/ChangeLog:

2014-11-25  Martin Galvan  <martin.galvan@tallertechnologies.com>

    * frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID.

---
  

Comments

Sergio Durigan Junior Nov. 25, 2014, 8:32 p.m. UTC | #1
On Tuesday, November 25 2014, Martin Galvan wrote:

> I noticed in frame_id_eq() we were checking for the "l" frame_id being invalid twice instead of checking both "l" and "r", so I corrected it.

Hi Martin,

Thanks for the patch.  I guess it is obvious enough that it could be
checked in without approval, but just to be safe, let's wait until a
maintainer approves it.  Meanwhile...

> gdb/ChangeLog:
>
> 2014-11-25  Martin Galvan  <martin.galvan@tallertechnologies.com>
>
>     * frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID.

The indentation of this ChangeLog entry is wrong.  You must use TAB
instead of whitespaces to indent the "*" part.

> ---
>
> diff --git a/gdb/frame.c b/gdb/frame.c
> index 0663af9..135b820 100644
> --- a/gdb/frame.c
> +++ b/gdb/frame.c
> @@ -614,7 +614,7 @@ frame_id_eq (struct frame_id l, struct frame_id r)
>         outer_frame_id.  */
>      eq = 1;
>    else if (l.stack_status == FID_STACK_INVALID
> -          || l.stack_status == FID_STACK_INVALID)
> +          || r.stack_status == FID_STACK_INVALID)

Here, the use of whitespaces is wrong too.  And it seems your e-mail
client has mangled the TAB of the old code as well.

>      /* Like a NaN, if either ID is invalid, the result is false.
>         Note that a frame ID is invalid iff it is the null frame ID.  */
>      eq = 0;
  
Martin Galvan Nov. 26, 2014, 1:19 a.m. UTC | #2
On Tue, Nov 25, 2014 at 5:32 PM, Sergio Durigan Junior
<sergiodj@redhat.com> wrote:
>
> On Tuesday, November 25 2014, Martin Galvan wrote:
>
> > I noticed in frame_id_eq() we were checking for the "l" frame_id being invalid twice instead of checking both "l" and "r", so I corrected it.
>
> Hi Martin,
>
> Thanks for the patch.  I guess it is obvious enough that it could be
> checked in without approval, but just to be safe, let's wait until a
> maintainer approves it.  Meanwhile...
>
> > gdb/ChangeLog:
> >
> > 2014-11-25  Martin Galvan  <martin.galvan@tallertechnologies.com>
> >
> >     * frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID.
>
> The indentation of this ChangeLog entry is wrong.  You must use TAB
> instead of whitespaces to indent the "*" part.

My mistake. Will remember that for any new patches I send :)
  

Patch

diff --git a/gdb/frame.c b/gdb/frame.c
index 0663af9..135b820 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -614,7 +614,7 @@  frame_id_eq (struct frame_id l, struct frame_id r)
        outer_frame_id.  */
     eq = 1;
   else if (l.stack_status == FID_STACK_INVALID
-          || l.stack_status == FID_STACK_INVALID)
+          || r.stack_status == FID_STACK_INVALID)
     /* Like a NaN, if either ID is invalid, the result is false.
        Note that a frame ID is invalid iff it is the null frame ID.  */
     eq = 0;