Message ID | 20211128015647.156104-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 5B0B43858415 for <patchwork@sourceware.org>; Sun, 28 Nov 2021 01:57:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B0B43858415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638064633; bh=89iL4Aau73bSdYU0f+Sj0EFDMA4rLwiQYmib9YcenZw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:From; b=mcL1XjSNxFUTtlqrGPtfmYM26ZFGAZd/MvB9WIP9w05L2UYPCWRxkus19ETwbVT1n +a81k9OPhqpLb63kf+WBLdubeMb5aPXoX+Q7Legq+ci0OcAuKBctqmhK0K6WqIWHmV iw8MMI2S5jOzS0DBvfFTrj2T5rw1pH76NIQQmZ54= 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 795EE385840F for <libabigail@sourceware.org>; Sun, 28 Nov 2021 01:57:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 795EE385840F 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 1ARLccgT017085 for <libabigail@sourceware.org>; Sun, 28 Nov 2021 01:57:02 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3ckc9t1sms-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <libabigail@sourceware.org>; Sun, 28 Nov 2021 01:57:01 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1AS1toCe030423 for <libabigail@sourceware.org>; Sun, 28 Nov 2021 01:57:01 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2104.outbound.protection.outlook.com [104.47.58.104]) by userp3020.oracle.com with ESMTP id 3cke4hwttb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <libabigail@sourceware.org>; Sun, 28 Nov 2021 01:57:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ntwStO1uFkVYwLtZ96fRY8LF+Mu3N3CObIj9qrs7XJ08RQBIyYy+HP3tc1xtvsXht7d9nRbCEKaaJIOVg0JhRZqshxi4AFu+YbSSBacxe3cRtq3eNo2XIdyKtJxto5ZtvhHNBz0cUt8R1XlMGZGJwgP7MNIKarp2KkOFmVFKWYiSNg7Cnf7uAIpMmW6KZLTPcENACj07t5mYDXsQRwxr6PXXptjRZzvNcQcX0teffcsWIyMblImt93AR8/IqKiwhRS1uj5+iFrDhB9HwW1L6TV4HgL26Kvs+aDgTnA9s4KjCOci4QFiJLi7Op5+3R2LJQc+pIfg5VwOeyhOIdJeDMQ== 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=89iL4Aau73bSdYU0f+Sj0EFDMA4rLwiQYmib9YcenZw=; b=FUzsNVrfaMnqzgh3tdqJjdLSvP+Urym/bA2kJo7KzWzmyqZzDrqQsJ5Lr1zN2Sy1dJ/SJXILlr632cBA8Ib7MogqFIZKGEBeBCvOOgVrnJsN4WzP0cw+3pMztTO+60sz/m5z/7rrsntVcT83XGHl69+oZtHtP+0Nd1q/iV8p+xZLbkZbrIxCC1P6VphUZ18dbB/3lQeskOTryqqq/yzuhMzpt7ixuB/G5GpB1mxzeXGQOjTHGLyfpL+uxcaUaKuHKkeb0uwlDZBRx92i2D1//PJxp2JWcqiALPQWGy77bU+6fIz2YLge6+Dq/qUFal8cgJ4W2f4DEPw2oUAn8nAWkw== 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 MN2PR10MB4175.namprd10.prod.outlook.com (2603:10b6:208:1d9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19; Sun, 28 Nov 2021 01:56:58 +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; Sun, 28 Nov 2021 01:56:58 +0000 To: libabigail@sourceware.org Subject: [PATCH v2] ctf-reader: Fix length in dynamic array definition Date: Sat, 27 Nov 2021 19:56:47 -0600 Message-Id: <20211128015647.156104-1-guillermo.e.martinez@oracle.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211126231718.119513-1-guillermo.e.martinez@oracle.com> References: <20211126231718.119513-1-guillermo.e.martinez@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SN4PR0701CA0003.namprd07.prod.outlook.com (2603:10b6:803:28::13) To BL0PR10MB2852.namprd10.prod.outlook.com (2603:10b6:208:76::22) MIME-Version: 1.0 Received: from localhost.localdomain (187.248.82.110) by SN4PR0701CA0003.namprd07.prod.outlook.com (2603:10b6:803:28::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23 via Frontend Transport; Sun, 28 Nov 2021 01:56:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec9ef237-a155-416c-57c4-08d9b2125bfd X-MS-TrafficTypeDiagnostic: MN2PR10MB4175: X-Microsoft-Antispam-PRVS: <MN2PR10MB4175AD7AC38C1955BDBA0068BA659@MN2PR10MB4175.namprd10.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OeJpYM6Pnp8ng31qkks8onLp6g+loeHH+GlZr4/LkpCGSF6Yqi+pTYQ87/Kp7TrS8+ZWPYDV3+2iVfY3UnJaa0K0jPoxwJmfqt80HVsYuLn7BXDpAg2JwNjlu7ZvmXGUfx3nFUMQlPhnFNi3mdTifS77tBoPpVUkSgJoY3vy2lgsdtP3yV7HM9iKzSB99n5LR0s7um1laCN5qWkk3tmvCp559Yrgr3lawynQN3qiEdCOkxViTZ2B2psTb82slCYmAKmdfEuRLK8rBEV93dDwLx3aZFCwgpLg+E2JDScFmHTwbITULOA766WCRIMGPwW+9ZqJZyK+EFNRRSgNcKvc98ZLp3iZoCSbsNwamFWGNaptHtBoYyz83qGy4EKBRGBMqvgIjsPpWAgax/A7env9/wKgyishnl8cvPsherHk0Yi+cxwYfTUTDHLOf/jnb/FGyPhUb+66ScYVjcMsiENGSQhQa6biIvzm6HV17GvYefhHpAVQo+SX4kGvI9NpHJU+6tT5EBBmKuderJHaQ02b1WwuOsBF5tbXpNi6FqOOM6Ki3PuwSsl4t3xOuuSi0uJ6ZkNlUC0H6Wi0gcOdy6a3/lsQt0SiTIMSZR8rfUDJp8/6OM0RZXLHuDdl6+Cu04nhK7N2Fw3ouOp5rJazGE+RbAoPMQrngJxNIUZc3h+p9nTvDs7Fh/SPZlkJyr7ziJe2Y94jJpNYVKMu02dE3+sWog== 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)(508600001)(8936002)(186003)(6506007)(66556008)(66476007)(4326008)(2616005)(6486002)(8676002)(6512007)(66946007)(2906002)(1076003)(316002)(36756003)(52116002)(107886003)(38100700002)(6666004)(956004)(6916009)(5660300002)(103116003)(26005)(86362001)(38350700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: F3PMwD7oHcG8pJ5gN2FueakOCxOv4mzlZ0SLqvFAATTt/EWw/QkZ0RM4h67DFONPnlKe/oEEJFOGD93Ip3NeCoHipKFOrUFwLMC0/YmrgM5e7ECYEW2HOnlSuriX+HLYsbVyfs26F4q7T7xb8ou8IvSUQHeeCll13UGSkOh4y3hiyarvHtntsQYHTSEOILZnNQ2/zQDv7Q2Teyff6LsnrN7mGnY+mzLP/8VBHX1PnJ+TlXrCkbZUZg4lXG2pyxq6QAw1rt69iMIiaaHpCtKG8AZziBqGGVZjIB4V3VxvUw5JAGBpuXK/LFqjNjV7Nxtdz2elMPsfi/oisWxoy1KXyxCtxMoOTXWuSvknQ5KVHONsbbdiuqskV6yG2ClmJelQN0ygt7NcVQOaCHoAsNutGW+6559MMMjcE8YNzs2Oz6elcRu4h9LKC96QoLfXdkT71j96EMNxGFivuPIkE3w79mBnfVXAOpabKjai7YeKIV3FS7mN3y+M5PCiuOf3lmXPRvMtc4kVEAvze54r2yrJtTJRMpGfb3pQt8vqhR8c4ZXDbIu28dxa/einYGkeRmQmNz/4VIR4IcufsS0sYIWAJtDOl4oR1+AVdJiS49htOy8JG+kv9OAwbEjCdHjyKXI0+egpJW1LmxnBAjTK7VUqfDJoi7M48mgkDyQ8u/MLjMV+M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d X-MS-Exchange-CrossTenant-AuthSource: BL0PR10MB2852.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2021 01:56:58.6902 (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: bngtwDGJFTbTKqB190ejENF3UxDYSoRkIfXa/NTv/yZk9qnQr6IXnVe9IX7Ru8A/+hUmAd3l8uKOGrw2wCaVDfaD8B2icJopnfuDHgmov6w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4175 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10181 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 phishscore=0 suspectscore=0 spamscore=0 adultscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111280009 X-Proofpoint-ORIG-GUID: WpF_uOcO40Lt3c8_2bsL1aiE1Ac3clKs X-Proofpoint-GUID: WpF_uOcO40Lt3c8_2bsL1aiE1Ac3clKs X-Spam-Status: No, score=-13.3 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 |
[v2] ctf-reader: Fix length in dynamic array definition
|
|
Commit Message
Guillermo E. Martinez
Nov. 28, 2021, 1:56 a.m. UTC
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'.
* src/abg-ctf-reader.cc (process_ctf_array_type):
set subrange_type::is_infinite when `upper_bound' value
is equal to `0'.
Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
---
src/abg-ctf-reader.cc | 6 ++++++
1 file changed, 6 insertions(+)
Comments
> 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'. > > * src/abg-ctf-reader.cc (process_ctf_array_type): > set subrange_type::is_infinite when `upper_bound' value > is equal to `0'. > > Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com> LGTM > --- > src/abg-ctf-reader.cc | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc > index c571d825..fbf6baef 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,10 @@ 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); > > + /* for VLAs number of array elements is 0 */ > + if (upper_bound.get_unsigned_value() == 0) > + is_infinite = true; > + > subrange.reset(new array_type_def::subrange_type(ctxt->ir_env, > "", > lower_bound, > @@ -517,6 +522,7 @@ process_ctf_array_type(read_context *ctxt, > if (!subrange) > return result; > > + subrange->is_infinite(is_infinite); > add_decl_to_scope(subrange, tunit->get_global_scope()); > canonicalize(subrange); > subranges.push_back(subrange);
Ping ... On Monday, November 29, 2021 7:32:54 AM CST Jose E. Marchesi wrote: > > > 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'. > > > > * src/abg-ctf-reader.cc (process_ctf_array_type): > > set subrange_type::is_infinite when `upper_bound' value > > is equal to `0'. > > > > Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com> > > LGTM > > ---
"Guillermo E. Martinez via Libabigail" <libabigail@sourceware.org> a écrit: > 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'. > > * src/abg-ctf-reader.cc (process_ctf_array_type): > set subrange_type::is_infinite when `upper_bound' value > is equal to `0'. > > Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com> Applied to master. Thanks! Cheers,
diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc index c571d825..fbf6baef 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,10 @@ 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); + /* for VLAs number of array elements is 0 */ + if (upper_bound.get_unsigned_value() == 0) + is_infinite = true; + subrange.reset(new array_type_def::subrange_type(ctxt->ir_env, "", lower_bound, @@ -517,6 +522,7 @@ process_ctf_array_type(read_context *ctxt, if (!subrange) return result; + subrange->is_infinite(is_infinite); add_decl_to_scope(subrange, tunit->get_global_scope()); canonicalize(subrange); subranges.push_back(subrange);