reader: Read array subrange length into an uint64_t
We read subrange length like an integer of type 'int" today. We should read it as an uint64_t. Fixed thus. * src/abg-reader.cc (build_subrange_type): Change the type of length to uint64_t and read it using strtoull. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
parent
6ac6cfb3f6
commit
7d5ef25b9c
|
@ -3841,7 +3841,7 @@ build_subrange_type(read_context& ctxt,
|
|||
if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
|
||||
name = CHAR_STR(s);
|
||||
|
||||
size_t length = 0;
|
||||
uint64_t length = 0;
|
||||
string length_str;
|
||||
bool is_infinite = false;
|
||||
if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "length"))
|
||||
|
@ -3849,7 +3849,7 @@ build_subrange_type(read_context& ctxt,
|
|||
if (string(CHAR_STR(s)) == "infinite")
|
||||
is_infinite = true;
|
||||
else
|
||||
length = atoi(CHAR_STR(s));
|
||||
length = strtoull(CHAR_STR(s), NULL, 0);
|
||||
}
|
||||
|
||||
string underlying_type_id;
|
||||
|
|
Loading…
Reference in New Issue