From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::223]) by sourceware.org (Postfix) with ESMTPS id 2DC8C3858D32 for ; Mon, 17 Oct 2022 14:13:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2DC8C3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=seketeli.org Received: (Authenticated sender: dodji@seketeli.org) by mail.gandi.net (Postfix) with ESMTPSA id 8C4EC60007; Mon, 17 Oct 2022 14:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seketeli.org; s=gm1; t=1666016027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9ZOBC45t8P7VPTN6/qp5MeGMrLuH5JNM6sO6HS4S/pk=; b=P5Ws3CwMd3YKPga2Ty+CM0HsmthKQ3txQR2VGqHqrNl3nX0fsPxS8r6WdmKz/3RD9JNLVo U270vJ/tVf3eMqWwwKHl3lh0I6dU4EKkH/nR8bg1xuGNPTOx3WD7Tu6TJs9a8+2FzGh42O 4hc6CWbVBEVh1v0/xmTp/5achNsC6rAjuQ9WTB5NrMF2dVfQG+sQnbttsz0D1/brAKahau bX3U/enni6bNAUACjCIaurL8HWpF6aCUfjW689KxXrbD48MuO715YborcU9P4cfkUIolI5 c55/p6ThHyTDydB/Za2YQ66bnngnqsjtgOXhp0AbhAgIdxPPZmhFsaGad/H2MA== Received: by localhost (Postfix, from userid 1000) id 26686581C53; Mon, 17 Oct 2022 16:13:46 +0200 (CEST) From: Dodji Seketeli To: Xiaole He via Libabigail Cc: Xiaole He , Xiaole He Subject: Re: [PATCH] abg-ir: add missing else Organization: Me, myself and I References: <20221016042642.37944-1-hexiaole1994@126.com> X-Operating-System: Fedora 38 X-URL: http://www.seketeli.net/~dodji Date: Mon, 17 Oct 2022 16:13:45 +0200 In-Reply-To: <20221016042642.37944-1-hexiaole1994@126.com> (Xiaole He via Libabigail's message of "Sun, 16 Oct 2022 04:26:42 +0000") Message-ID: <87pmeqr10m.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello Xiaole, Xiaole He via Libabigail a =C3=A9crit: > From: Xiaole He > > In 'bind_function_type_life_time' function of 'src/abg-ir.cc', the code > obtains the member 'const environment*' of 'class function_type', that > is, the 'e' variable in below code. And assure the obtained > 'environment*' is same as the 'const environment*' of the > 'class translation_unit', that is, the'env' variable in below code: > > /* src/abg-ir.cc begin */ > 1 void > 2 translation_unit::bind_function_type_life_time(function_type_sptr ftyp= e) > 3 { > 4 ... > 5 const environment* env =3D get_environment(); > 6 ... > 7 if (const environment* e =3D ftype->get_environment()) > 8 ABG_ASSERT(env =3D=3D e); > 9 ftype->set_environment(const_cast(env)); > 10 > 11 if (const translation_unit* existing_tu =3D ftype->get_translation_u= nit()) > 12 ABG_ASSERT(existing_tu =3D=3D this); > 13 else > 14 ftype->set_translation_unit(const_cast(this)); > 15 ... > /* src/abg-ir.cc end */ > > There was a missing 'else' between the 'line 8' and line 9', as the > explicit 'else' at the 'line 13'. Without the 'else' between the > 'line 8' and line 9', there will be a redundant assignment at 'line 9' > under the condition when the 'env' is equal to 'e'. > This patch add the missing 'else' between the 'line 8' and 'line 9'. > > * src/abg-ir.cc (bind_function_type_life_time): add missing > else > > Signed-off-by: Xiaole He > Tested-by: Xiaole He Applied to the master branch. Thanks! [...] Cheers, --=20 Dodji