View | Details | Raw Unified | Return to bug 28294
Collapse All | Expand All

(-)a/libdw/dwarf_aggregate_size.c (-7 / +38 lines)
Lines 83-101 array_size (Dwarf_Die *die, Dwarf_Word *size, Link Here
83
	    }
83
	    }
84
	  else
84
	  else
85
	    {
85
	    {
86
	      bool is_signed = true;
87
	      if (INTUSE(dwarf_attr) (get_type (&child, attr_mem, &type_mem),
88
				      DW_AT_encoding, attr_mem) != NULL)
89
		{
90
		  Dwarf_Word encoding;
91
		  if (INTUSE(dwarf_formudata) (attr_mem, &encoding) == 0)
92
		    is_signed = (encoding == DW_ATE_signed
93
				 || encoding == DW_ATE_signed_char);
94
		}
95
86
	      Dwarf_Sword upper;
96
	      Dwarf_Sword upper;
87
	      Dwarf_Sword lower;
97
	      Dwarf_Sword lower;
88
	      if (INTUSE(dwarf_formsdata) (INTUSE(dwarf_attr_integrate)
98
	      if (is_signed)
89
					   (&child, DW_AT_upper_bound,
99
		{
90
					    attr_mem), &upper) != 0)
100
		  if (INTUSE(dwarf_formsdata) (INTUSE(dwarf_attr_integrate)
91
		return -1;
101
					       (&child, DW_AT_upper_bound,
102
						attr_mem), &upper) != 0)
103
		    return -1;
104
		}
105
	      else
106
		{
107
		  Dwarf_Word unsigned_upper;
108
		  if (INTUSE(dwarf_formudata) (INTUSE(dwarf_attr_integrate)
109
					       (&child, DW_AT_upper_bound,
110
						attr_mem), &unsigned_upper) != 0)
111
		    return -1;
112
		  upper = unsigned_upper;
113
		}
92
114
93
	      /* Having DW_AT_lower_bound is optional.  */
115
	      /* Having DW_AT_lower_bound is optional.  */
94
	      if (INTUSE(dwarf_attr_integrate) (&child, DW_AT_lower_bound,
116
	      if (INTUSE(dwarf_attr_integrate) (&child, DW_AT_lower_bound,
95
						attr_mem) != NULL)
117
						attr_mem) != NULL)
96
		{
118
		{
97
		  if (INTUSE(dwarf_formsdata) (attr_mem, &lower) != 0)
119
		  if (is_signed)
98
		    return -1;
120
		    {
121
		      if (INTUSE(dwarf_formsdata) (attr_mem,&lower) != 0)
122
			return -1;
123
		    }
124
		  else
125
		    {
126
		      Dwarf_Word unsigned_lower;
127
		      if (INTUSE(dwarf_formudata) (attr_mem, &unsigned_lower) != 0)
128
			return -1;
129
		      lower = unsigned_lower;
130
		    }
99
		}
131
		}
100
	      else
132
	      else
101
		{
133
		{
102
- 

Return to bug 28294