public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix wrong assertions
@ 2015-05-09 18:57 Andreas Schwab
  2015-05-13 14:01 ` Jan Kratochvil
  2015-05-19 20:47 ` [patch] testcase: tailcall assertion [Re: [PATCH] Fix wrong assertions] Jan Kratochvil
  0 siblings, 2 replies; 12+ messages in thread
From: Andreas Schwab @ 2015-05-09 18:57 UTC (permalink / raw)
  To: gdb-patches

Both callers and callees are lengths, and the sum of them can validly
equal the total length.

Andreas.

	PR symtab/18392
	* dwarf2-frame-tailcall.c (pretended_chain_levels): Correct
	assertion.
	* dwarf2loc.c (chain_candidate): Likewise.
---
 gdb/dwarf2-frame-tailcall.c | 2 +-
 gdb/dwarf2loc.c             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/dwarf2-frame-tailcall.c b/gdb/dwarf2-frame-tailcall.c
index b412a5b..f964ab2 100644
--- a/gdb/dwarf2-frame-tailcall.c
+++ b/gdb/dwarf2-frame-tailcall.c
@@ -197,7 +197,7 @@ pretended_chain_levels (struct call_site_chain *chain)
     return chain->length;
 
   chain_levels = chain->callers + chain->callees;
-  gdb_assert (chain_levels < chain->length);
+  gdb_assert (chain_levels <= chain->length);
 
   return chain_levels;
 }
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index d811106..29b265b 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -827,7 +827,7 @@ chain_candidate (struct gdbarch *gdbarch, struct call_site_chain **resultp,
      PC again.  In such case there must be two different code paths to reach
      it, therefore some of the former determined intermediate PCs must differ
      and the unambiguous chain gets shortened.  */
-  gdb_assert (result->callers + result->callees < result->length);
+  gdb_assert (result->callers + result->callees <= result->length);
 }
 
 /* Create and return call_site_chain for CALLER_PC and CALLEE_PC.  All the
-- 
2.4.0

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-06-01 12:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-09 18:57 [PATCH] Fix wrong assertions Andreas Schwab
2015-05-13 14:01 ` Jan Kratochvil
2015-05-13 14:35   ` Andreas Schwab
2015-05-29  9:31   ` Yao Qi
2015-05-29 11:31     ` Jan Kratochvil
2015-05-29 13:43       ` Yao Qi
2015-05-29 14:10         ` Jan Kratochvil
2015-05-29 16:33           ` Yao Qi
2015-05-30  7:44             ` Jan Kratochvil
2015-06-01 11:35           ` Yao Qi
2015-06-01 12:05             ` [commit] " Jan Kratochvil
2015-05-19 20:47 ` [patch] testcase: tailcall assertion [Re: [PATCH] Fix wrong assertions] Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).