Message ID | 20211126231718.119513-1-guillermo.e.martinez@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <libabigail-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 441E03857C4C for <patchwork@sourceware.org>; Fri, 26 Nov 2021 23:17:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 441E03857C4C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1637968661; bh=wuRWaORXdrm57wvijxyvseDBbYK16mVJcs5/zDTyOTI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:From; b=yHpP4/iIZfRinzphkSqJMS7aQtTIS3SVtydOoaTuvlH1McK6cY9S4KFRm5r+A5gli U+GGLZy+refKZzcp/jH1bWZtWcMhD8+kYwY3Z3hJTv6ciSl3ySO32Gb7weljGMElWl 1336z1027gpDtOwq3Hk3+F57wTH55DypipOVyb6I= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 519F13858D39 for <libabigail@sourceware.org>; Fri, 26 Nov 2021 23:17:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 519F13858D39 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AQLVwU1017927 for <libabigail@sourceware.org>; Fri, 26 Nov 2021 23:17:33 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3ck1vms23p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <libabigail@sourceware.org>; Fri, 26 Nov 2021 23:17:33 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1AQNFWdO160512 for <libabigail@sourceware.org>; Fri, 26 Nov 2021 23:17:32 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2045.outbound.protection.outlook.com [104.47.74.45]) by userp3030.oracle.com with ESMTP id 3cep55w3rc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <libabigail@sourceware.org>; Fri, 26 Nov 2021 23:17:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mIjVTzfvvKHVd0EcHgG1PROxH2VR+I8oGnEk2KYczW5WyE3sQVofijMAICVfqUzrmljNZ5C8aBAOd+qop3tgi33myuYnmk+fFcHnLgTu2F7m9ufHpcT/vm1iGtPpN0sdEAzfGkP0OZ2+XewziU63hMzNTk8wRP9Hz8o9nVmqD9bvyCtR5/rhv23qiS3hSKq4MrqGtx+1NGQIlLAEh4mZPA74v5iSuD9zQ6+agBQnqPubG5yN62VOQHMOq2u1tvhojr7VN9XMx11e6XZW6FRT9BulwtVgTBqic6N/L/9ri+/zi0CPZhcrS0X9dTedlX7yPGKLgIxNOPrlXFIYoi2TWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wuRWaORXdrm57wvijxyvseDBbYK16mVJcs5/zDTyOTI=; b=m8HkPVD2Vh2vSI5+KDDFfUZ4Vfh7DyzbIInqfTZDfXN0xPboYEdKFXDTeFtzi8WH6Jj3FhB0M/yWx3UVkd1C95MQQwrXd+4svvcltW8kl6qLnRffJS6DjvhtMLumAICBysesBLt2MAgoWPKfC2IMQuJZhvvA4lZ4TpeBd5C3eXrYPY6VXG1oj+3To4apS4x2Jui1hXb2kZ0JnRhm2QZElVrFElhlQDIY/U2GTjhhCBGWUKj8W72xR4mjgpXKLNgLpVQMZ5kwAMVmVPa4g+5mZYRZRnCEf9nXYUxeQp4YiEj58n+YUbcSUnnavZtwSjYuTx4fnZ40KRBo8eX3vjdJbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from BL0PR10MB2852.namprd10.prod.outlook.com (2603:10b6:208:76::22) by MN2PR10MB3968.namprd10.prod.outlook.com (2603:10b6:208:1ba::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.22; Fri, 26 Nov 2021 23:17:30 +0000 Received: from BL0PR10MB2852.namprd10.prod.outlook.com ([fe80::6927:5e6b:31ff:14bd]) by BL0PR10MB2852.namprd10.prod.outlook.com ([fe80::6927:5e6b:31ff:14bd%3]) with mapi id 15.20.4734.023; Fri, 26 Nov 2021 23:17:30 +0000 To: libabigail@sourceware.org Subject: [PATCH] ctf-reader: Fix length in dynamic array definition Date: Fri, 26 Nov 2021 17:17:18 -0600 Message-Id: <20211126231718.119513-1-guillermo.e.martinez@oracle.com> X-Mailer: git-send-email 2.33.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SN7PR04CA0177.namprd04.prod.outlook.com (2603:10b6:806:125::32) To BL0PR10MB2852.namprd10.prod.outlook.com (2603:10b6:208:76::22) MIME-Version: 1.0 Received: from sali.us.oracle.com (2606:b400:8004:44::1a) by SN7PR04CA0177.namprd04.prod.outlook.com (2603:10b6:806:125::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.22 via Frontend Transport; Fri, 26 Nov 2021 23:17:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c4dee8d2-0e28-46da-1fe3-08d9b132eb19 X-MS-TrafficTypeDiagnostic: MN2PR10MB3968: X-Microsoft-Antispam-PRVS: <MN2PR10MB39689F116FCF0757CB5C45ACBA639@MN2PR10MB3968.namprd10.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W7vMk17OeoXaRmRYU2+qL0De/xodO6vYhz9QKhDiNLMxvDUbrj7XH55Iwmfnm7gubDYzf7jMT2k0VSvHD6LrMx5CwMIvZ9s1p5AEP1S7A4VlDGpIXiUs3KvwDcT3pLo94Pv/rmgAC7S9qAqEBccTqLmhj5A9wsCV2nf69oeQhKvmf2lOOuLxnwYDflz4ZcQ6np9YVIHg+WwV20haulidhUIqre45o0cU4BKmPA0lZYClvDIFAGA4hhf0KCkW6vzR6xF/ByE7xxI2cViTC6cSlGfuzKPprklPZz4OOzY7XhDMYdHouXTJ57rsR9LSOMpOOC7NbYqPCDOjXB+2n1u611ClWIzZYz+BbljmQOaQqJ4/qO8if6liP7N1H+/mrPOUqlT7CwzOtAh5JKaaNJ0acHsfwccylqW7hiFYGwdsM736/GRUWk3cX6g8X57C2Lr4I3DsXMYDirCuBqmACYz0hKN52FK2jZaAHh91pNThWq5OJG4tojySfvNvr/h3PEPkFUExmqmM5XdxJA+mbCEkvepinpKDepaVgUGE+TLFQtrnavNmJHPqFwX/U6YOP4e3SLPgKEdCsqomRTCsSKbWzJNBX1YSq9Pri5OAiKqBkWgGGdClYkKqLkAYFEHvr2Im22N3sSs+LS9kg2KgIc+FBQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL0PR10MB2852.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(6486002)(66946007)(66476007)(2906002)(186003)(38100700002)(66556008)(52116002)(36756003)(8676002)(4326008)(103116003)(86362001)(107886003)(2616005)(5660300002)(6666004)(508600001)(6916009)(316002)(7696005)(8936002)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: G+9veqehYsIMjzM9fDTGaI5eCZJx+S1Wa4rlpw2UvfNXtKvHIILX+MtxrFhB1rFcSgbx6Fx1uRNdwpQ7/ajme13hRS/D0xZ/GZXkbg4DKTz0MNq8ptsAXP5nu6ZZ+Yf0d4iWwnR2lAQgMpk/B2O1f5wqG1ikTKpyZR225oUyAaKr6FKGIjaIyehaluY/JtqQ1VU6NiItLZ6R2bVyew1OrYt+lPkrmNCafm/OfZTJs80T3tLMmw9XdCqSjXtsXAN2YQZbt22phFtMEyEFg4/b0YWC2yDJ8pkON73BYhskA7TqnQuxY630h1ZfmwdkNwSRW6KFlaxU4YTMGQs8pqNinW7INI6OmMgAknG6jrK0LcmMIHVkpjUuPOQUPOH15Olkf8b8G+h70KUlgKP5mcJdO7aNe/ZxcZVmi6FAWlTPdt6pzZGWMlnrrl4yuAVD9w4twVxNcpDDQbK8jM46buKauqgkYgvRBCDsLJvGiUH6Lxnq0C8MWg5wVy4BSb2fD7N+PKflZA0lpwobSOC4W/1xRK90bwg1vh73cyrUCNIZWdrhebkWcdCHhhp3hVPmtryjYg/bzm3hZmuF2eO5K0qijFrpIOdTz4P/j65MwEiXe5hbNwFHcQ+pBm9CgyBOjdce2NWoPhFE3P+U/2nNWDVrvfzhV+/oRvvB3h98wzsA9iLE6k67MEBO58V8qYqMA9v4W6HeJGw2e2Ba8sETNcl0FY/LSE3KX8xFt0CZavUtGrh9kJYu1+u3a1VNElEcBZ10zhFJKPoh4uYnviOtiYULLQISSwcKZto/yCWWa82B/jKROqMGu4LHTwBGd6wxSX5S1jWOWvNBK57/KTfOmCgm+qWvEfPxR/yDFREiiaijf4EabaGAH3qyM42f+YUr7qkYKS0bj4gLUFaj0MvgqUqPDoCKsPwPlyW2Z6h88gUD7bmN0eHxckwULgHKzjAZsoo7B7GTPo+vbAQAhDoGev5YTF55QuQRjjx7qaT9eYLXb/je/JKwlUaUf0gYzSpxZtYOt8xCdG2cO5lTyE8l+eAEIm6B+5rLrkaS39xCaCAz6LwlRFQ0hclAcINmVB9c4dP7lnQSjCTymKM8PT4eXI8VlsHsIc5XKuzScTr2oESLoZDiMRy+yea2ZpjBCeljGzl199IjkHbbaSwyOgXaYfdHDZ0qB/xc7IHuFDGprM9uo1gWKdO1dh2QrmrcOc67yzUaKNw9XbwjjHSR7Daks5kXdtPThDi/eWj5bZ9YTyDW+AoFdynL799WCgJS5tyGnldM0t6xyuvDyRBTn3oLulaBO7EicWGkUpp8Nos1JAMB5KKtrvccoch54ZF9voTP0vtADk5cAqx74WW6r+Stm9OvBlkwLjHrT9Ksnn40hBpw6MY5Urw5jXbEiwI++cYT3tNAvay4XqbA17oJm7sshJzSvbxIrFdGk2azNa03GyU5g49MDpZqahlndwFmF6YoXUGFf6VQlCdF8urhtlg5oh62f8NZsvadkXPaB05EJAfdUywIkRxV4EN2y6SJcT0MTR9Ovtukxa7/VITADJiC7hf8DB3Gp9RtJf5oP6kupLb8iz2h47weUrc3MKnjgVclhKe4cwTf1E/Uk1r3jHkhc1AdT3TOD7crQ1wEm3e2OweVq66U307aRzknXuDCf06wm1P/B329ee7ngbZ8FNbWnABYycxY0SYDVuHgREJDGLXYgkU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4dee8d2-0e28-46da-1fe3-08d9b132eb19 X-MS-Exchange-CrossTenant-AuthSource: BL0PR10MB2852.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2021 23:17:30.2298 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CcY1DZPViDrEGSJ+ETj6+963lBl+3c+Q6OBVXHJ5RvSqSfSERZRDbaRYQT0Atau87VDzToTxTT1jum8T4pHqKAaeB8jQlGMFLDxETP9+eCI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB3968 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10180 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111260137 X-Proofpoint-ORIG-GUID: valWS5QZz4x8d6aJHeHk9ke2W5wxUn-G X-Proofpoint-GUID: valWS5QZz4x8d6aJHeHk9ke2W5wxUn-G X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project <libabigail.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libabigail>, <mailto:libabigail-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libabigail/> List-Help: <mailto:libabigail-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libabigail>, <mailto:libabigail-request@sourceware.org?subject=subscribe> From: "Guillermo E. Martinez via Libabigail" <libabigail@sourceware.org> Reply-To: "Guillermo E. Martinez" <guillermo.e.martinez@oracle.com> Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" <libabigail-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
ctf-reader: Fix length in dynamic array definition
|
|
Commit Message
Guillermo E. Martinez
Nov. 26, 2021, 11:17 p.m. UTC
Hello libabigail team,
This patch fix the `length' property of `subrange' node when
we define a dynamic length array,
Please let me know your comments,
Thanks in advanced!,
Guillermo
Defining an array type with dynamic length, node `subrange'
in the abixml file doesn't write the accurate `length'
property `infinite', instead `1' is written:
<subrange length='1' .../>
So, member function `array_type_def::subrange_type::is_infinite'
is set when `upper_bound' value is equal to `0' or UINT64_MAX.
* src/abg-ctf-reader.cc (process_ctf_array_type):
set subrange_type::is_infinite when `upper_bound' value
is equal to `0' or UINT64_MAX.
Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
---
src/abg-ctf-reader.cc | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
Comments
> Hello libabigail team, > > This patch fix the `length' property of `subrange' node when > we define a dynamic length array, > > Please let me know your comments, > > Thanks in advanced!, > Guillermo > > Defining an array type with dynamic length, node `subrange' > in the abixml file doesn't write the accurate `length' > property `infinite', instead `1' is written: > <subrange length='1' .../> > > So, member function `array_type_def::subrange_type::is_infinite' > is set when `upper_bound' value is equal to `0' or UINT64_MAX. > > * src/abg-ctf-reader.cc (process_ctf_array_type): > set subrange_type::is_infinite when `upper_bound' value > is equal to `0' or UINT64_MAX. > > Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com> > --- > src/abg-ctf-reader.cc | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc > index c571d825..687686d9 100644 > --- a/src/abg-ctf-reader.cc > +++ b/src/abg-ctf-reader.cc > @@ -472,6 +472,7 @@ process_ctf_array_type(read_context *ctxt, > { > array_type_def_sptr result; > ctf_arinfo_t ctf_ainfo; > + bool is_infinite = false; > > /* First, get the information about the CTF array. */ > if (static_cast<ctf_id_t>(ctf_array_info(ctf_dictionary, > @@ -507,6 +508,19 @@ process_ctf_array_type(read_context *ctxt, > lower_bound.set_unsigned(0); /* CTF supports C only. */ > upper_bound.set_unsigned(nelems > 0 ? nelems - 1 : 0U); > > + if (upper_bound.get_unsigned_value() == 0) > + { > + is_infinite = true; > + } These braces are superfluous. > + if (UINT64_MAX == upper_bound.get_unsigned_value()) > + { > + // If the upper_bound size is the max of the integer value, then > + // it most certainly means infinite size. > + is_infinite = true; > + upper_bound.set_unsigned(0); > + } Is that specified by the CTF spec? > + > subrange.reset(new array_type_def::subrange_type(ctxt->ir_env, > "", > lower_bound, > @@ -517,6 +531,12 @@ process_ctf_array_type(read_context *ctxt, > if (!subrange) > return result; > > + subrange->is_infinite(is_infinite); > + ABG_ASSERT(subrange->is_infinite() > + || (subrange->get_length() == > + (uint64_t) (subrange->get_upper_bound() > + - subrange->get_lower_bound() + 1))); Hm why this assert? > + > add_decl_to_scope(subrange, tunit->get_global_scope()); > canonicalize(subrange); > subranges.push_back(subrange);
On Saturday, November 27, 2021 12:03:23 PM CST Jose E. Marchesi wrote: > > > Hello libabigail team, > > > > This patch fix the `length' property of `subrange' node when > > we define a dynamic length array, > > > > Please let me know your comments, > > > > Thanks in advanced!, > > Guillermo > > > > Defining an array type with dynamic length, node `subrange' > > in the abixml file doesn't write the accurate `length' > > property `infinite', instead `1' is written: > > <subrange length='1' .../> > > > > So, member function `array_type_def::subrange_type::is_infinite' > > is set when `upper_bound' value is equal to `0' or UINT64_MAX. > > > > * src/abg-ctf-reader.cc (process_ctf_array_type): > > set subrange_type::is_infinite when `upper_bound' value > > is equal to `0' or UINT64_MAX. > > > > Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com> > > --- > > src/abg-ctf-reader.cc | 20 ++++++++++++++++++++ > > 1 file changed, 20 insertions(+) > > > > diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc > > index c571d825..687686d9 100644 > > --- a/src/abg-ctf-reader.cc > > +++ b/src/abg-ctf-reader.cc > > @@ -472,6 +472,7 @@ process_ctf_array_type(read_context *ctxt, > > { > > array_type_def_sptr result; > > ctf_arinfo_t ctf_ainfo; > > + bool is_infinite = false; > > > > /* First, get the information about the CTF array. */ > > if (static_cast<ctf_id_t>(ctf_array_info(ctf_dictionary, > > @@ -507,6 +508,19 @@ process_ctf_array_type(read_context *ctxt, > > lower_bound.set_unsigned(0); /* CTF supports C only. */ > > upper_bound.set_unsigned(nelems > 0 ? nelems - 1 : 0U); > > > > + if (upper_bound.get_unsigned_value() == 0) > > + { > > + is_infinite = true; > > + } > > These braces are superfluous. OK, I'll will remove curly braces in next version. > > + if (UINT64_MAX == upper_bound.get_unsigned_value()) > > + { > > + // If the upper_bound size is the max of the integer value, then > > + // it most certainly means infinite size. > > + is_infinite = true; > > + upper_bound.set_unsigned(0); > > + } > > Is that specified by the CTF spec? Ohh .. sorry is for DWARF, will be remove in next patch. > > + > > subrange.reset(new array_type_def::subrange_type(ctxt->ir_env, > > "", > > lower_bound, > > @@ -517,6 +531,12 @@ process_ctf_array_type(read_context *ctxt, > > if (!subrange) > > return result; > > > > + subrange->is_infinite(is_infinite); > > + ABG_ASSERT(subrange->is_infinite() > > + || (subrange->get_length() == > > + (uint64_t) (subrange->get_upper_bound() > > + - subrange->get_lower_bound() + 1))); > > Hm why this assert? After previous comment it's not required. > > > + > > add_decl_to_scope(subrange, tunit->get_global_scope()); > > canonicalize(subrange); > > subranges.push_back(subrange); > Thanks Jose! guillermo
diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc index c571d825..687686d9 100644 --- a/src/abg-ctf-reader.cc +++ b/src/abg-ctf-reader.cc @@ -472,6 +472,7 @@ process_ctf_array_type(read_context *ctxt, { array_type_def_sptr result; ctf_arinfo_t ctf_ainfo; + bool is_infinite = false; /* First, get the information about the CTF array. */ if (static_cast<ctf_id_t>(ctf_array_info(ctf_dictionary, @@ -507,6 +508,19 @@ process_ctf_array_type(read_context *ctxt, lower_bound.set_unsigned(0); /* CTF supports C only. */ upper_bound.set_unsigned(nelems > 0 ? nelems - 1 : 0U); + if (upper_bound.get_unsigned_value() == 0) + { + is_infinite = true; + } + + if (UINT64_MAX == upper_bound.get_unsigned_value()) + { + // If the upper_bound size is the max of the integer value, then + // it most certainly means infinite size. + is_infinite = true; + upper_bound.set_unsigned(0); + } + subrange.reset(new array_type_def::subrange_type(ctxt->ir_env, "", lower_bound, @@ -517,6 +531,12 @@ process_ctf_array_type(read_context *ctxt, if (!subrange) return result; + subrange->is_infinite(is_infinite); + ABG_ASSERT(subrange->is_infinite() + || (subrange->get_length() == + (uint64_t) (subrange->get_upper_bound() + - subrange->get_lower_bound() + 1))); + add_decl_to_scope(subrange, tunit->get_global_scope()); canonicalize(subrange); subranges.push_back(subrange);