代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libabigail 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 1ed036e2573e1fc9a1a0aed720eee20a921a38ed Mon Sep 17 00:00:00 2001
From: Xiaole He <hexiaole@kylinos.cn>
Date: Sun, 16 Oct 2022 04:26:42 +0000
Subject: [PATCH 1/3] abg-ir: add missing else
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 ftype)
3 {
4 ...
5 const environment* env = get_environment();
6 ...
7 if (const environment* e = ftype->get_environment())
8 ABG_ASSERT(env == e);
9 ftype->set_environment(const_cast<environment*>(env));
10
11 if (const translation_unit* existing_tu = ftype->get_translation_unit())
12 ABG_ASSERT(existing_tu == this);
13 else
14 ftype->set_translation_unit(const_cast<translation_unit*>(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 <hexiaole@kylinos.cn>
Tested-by: Xiaole He <hexiaole@kylinos.cn>
---
src/abg-ir.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index 4f19e07..a93c494 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -1394,7 +1394,8 @@ translation_unit::bind_function_type_life_time(function_type_sptr ftype) const
// translation unit.
if (const environment* e = ftype->get_environment())
ABG_ASSERT(env == e);
- ftype->set_environment(const_cast<environment*>(env));
+ else
+ ftype->set_environment(const_cast<environment*>(env));
if (const translation_unit* existing_tu = ftype->get_translation_unit())
ABG_ASSERT(existing_tu == this);
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。