public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [multi-file] Handle DW_FORM_ref_addr reference that points to containing unit
@ 2019-01-01  0:00 Tom de Vries
  2019-01-01  0:00 ` [committed][multi-file] Handle intra-CU DW_FORM_ref_addr reference Tom de Vries
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz, jakub

[ Submitted earlier off-list ]

Hi,

For test-cases with DW_FORM_ref_addr attributes that point to within the CU
containing the attribute, we run into the following assert in multifile mode:
...
dwz: dwz.c:1984: checksum_die: Assertion `
  ((!op_multifile && !rd_multifile && !fi_multifile) || cu != die_cu (ref))
  && (!op_multifile || cu->cu_chunk == die_cu (ref)->cu_chunk)
  ' failed.
...

This conservative fix detects the situation, and instead of asserting stops
further processing of the DIE.

OK for trunk?

Thanks,
- Tom

[multi-file] Handle DW_FORM_ref_addr reference that points to containing unit

2019-02-05  Tom de Vries  <tdevries@suse.de>

	PR dwz/24170
	* dwz.c (checksum_die): Handle DW_FORM_ref_addr references that points
	to containing unit conservatively.

---
 dwz.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/dwz.c b/dwz.c
index 4ef8657..0415630 100644
--- a/dwz.c
+++ b/dwz.c
@@ -1979,10 +1979,13 @@ checksum_die (DSO *dso, dw_cu_ref cu, dw_die_ref top_die, dw_die_ref die)
 		}
 	      if (unlikely (op_multifile) && ref->die_collapsed_child)
 		ref = ref->die_parent;
-	      assert (((!op_multifile && !rd_multifile && !fi_multifile)
-		       || cu != die_cu (ref))
-		      && (!op_multifile
-			  || cu->cu_chunk == die_cu (ref)->cu_chunk));
+	      if (cu == die_cu (ref))
+		{
+		  die->die_ck_state = CK_BAD;
+		  return 0;
+		}
+	      assert (!op_multifile
+		      || cu->cu_chunk == die_cu (ref)->cu_chunk);
 	      handled = true;
 	      break;
 	    }

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

end of thread, other threads:[~2019-06-25 10:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [PATCH] [multi-file] Handle DW_FORM_ref_addr reference that points to containing unit Tom de Vries
2019-01-01  0:00 ` [committed][multi-file] Handle intra-CU DW_FORM_ref_addr reference Tom de Vries

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).