From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42140 invoked by alias); 30 Mar 2017 02:06:00 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 42036 invoked by uid 48); 30 Mar 2017 02:05:56 -0000 From: "kubo at jiubao dot org" To: elfutils-devel@sourceware.org Subject: [Bug libdw/21330] New: dwarf_peel_type() loops infinitely for typedef const struct ... Date: Thu, 30 Mar 2017 02:06:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: libdw X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kubo at jiubao dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2017-q1/txt/msg00146.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D21330 Bug ID: 21330 Summary: dwarf_peel_type() loops infinitely for typedef const struct ... Product: elfutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: libdw Assignee: unassigned at sourceware dot org Reporter: kubo at jiubao dot org CC: elfutils-devel at sourceware dot org Target Milestone: --- When a type is defined as "typedef const struct foo foo_t", dwarf_peel_type= () for foo_t loops infinitely. 38 int 39 dwarf_peel_type (Dwarf_Die *die, Dwarf_Die *result) 40 { 41 int tag; 42=20 43 /* Ignore previous errors. */ 44 if (die =3D=3D NULL) 45 return -1; 46=20 47 *result =3D *die; 48 tag =3D INTUSE (dwarf_tag) (result); 49 while (tag =3D=3D DW_TAG_typedef 50 || tag =3D=3D DW_TAG_const_type 51 || tag =3D=3D DW_TAG_volatile_type 52 || tag =3D=3D DW_TAG_restrict_type 53 || tag =3D=3D DW_TAG_atomic_type) 54 { 55 Dwarf_Attribute attr_mem; 56 Dwarf_Attribute *attr =3D INTUSE (dwarf_attr_integrate) (die, DW_AT_type, 57 &attr_mem= ); 58 if (attr =3D=3D NULL) 59 return 1; 60=20 61 if (INTUSE (dwarf_formref_die) (attr, result) =3D=3D NULL) 62 return -1; 63=20 64 tag =3D INTUSE (dwarf_tag) (result); 65 } ... dwarf_tag() at line 48 returns DW_TAG_typedef. dwarf_attr_integrate() and dwarf_formref_die() sets DW_AT_type of die to result. dwarf_tag() at line 64 returns DW_TAG_const. dwarf_attr_integrate() and dwarf_formref_die() sets same value to result because the first argument of dwarf_attr_integrate() is unchanged. dwarf_tag() at line 64 returns same value forever. --=20 You are receiving this mail because: You are on the CC list for the bug.