Fix crash in Ada "catch exception"

Message ID 20190920174038.9760-1-tromey@adacore.com
State New
Headers show
Series
  • Fix crash in Ada "catch exception"
Related show

Commit Message

Tom Tromey Sept. 20, 2019, 5:40 p.m.
PR ada/24919 concerns a crash that Tom de Vries noticed when running
the "catch_ex" Ada test case.  He sent a test executable and tracked
this down to commit f21c2bd7b7 ("Fix Fortran regression with variables
in nested functions").

Looking at that patch, you can see the obvious error:

    -  return 0;
    +  return true;

Oops!  This patch fixes the bug.

Tested on x86-64 Fedora 29.

gdb/ChangeLog
2019-09-20  Tom Tromey  <tromey@adacore.com>

	PR ada/24919:
	* block.c (contained_in): Fix final return value.
---
 gdb/ChangeLog | 5 +++++
 gdb/block.c   | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

-- 
2.20.1

Comments

Joel Brobecker Sept. 20, 2019, 7:24 p.m. | #1
> PR ada/24919 concerns a crash that Tom de Vries noticed when running

> the "catch_ex" Ada test case.  He sent a test executable and tracked

> this down to commit f21c2bd7b7 ("Fix Fortran regression with variables

> in nested functions").

> 

> Looking at that patch, you can see the obvious error:

> 

>     -  return 0;

>     +  return true;

> 

> Oops!  This patch fixes the bug.


Indeed!

> gdb/ChangeLog

> 2019-09-20  Tom Tromey  <tromey@adacore.com>

> 

> 	PR ada/24919:

> 	* block.c (contained_in): Fix final return value.


Looks good to me, Tom.

-- 
Joel
Tom Tromey Sept. 20, 2019, 7:24 p.m. | #2
>> gdb/ChangeLog

>> 2019-09-20  Tom Tromey  <tromey@adacore.com>

>> 

>> PR ada/24919:

>> * block.c (contained_in): Fix final return value.


Joel> Looks good to me, Tom.

Thanks, I'm going to check it in.

Tom

Patch

diff --git a/gdb/block.c b/gdb/block.c
index ca4dc22cf30..5ba44d47ba7 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -86,7 +86,7 @@  contained_in (const struct block *a, const struct block *b,
     }
   while (a != NULL);
 
-  return true;
+  return false;
 }