From ebf6389c298edf6299acf6cf2b8492f93a010ca1 Mon Sep 17 00:00:00 2001 From: Roman Rusyaev Date: Thu, 28 Jul 2022 13:55:22 +0300 Subject: [PATCH] Fix comparison of two constants in case when sign or bit-width is different --- src/mapleall/maple_ir/src/mir_nodes.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mapleall/maple_ir/src/mir_nodes.cpp b/src/mapleall/maple_ir/src/mir_nodes.cpp index 0b37643e0a..579be730c5 100644 --- a/src/mapleall/maple_ir/src/mir_nodes.cpp +++ b/src/mapleall/maple_ir/src/mir_nodes.cpp @@ -2520,7 +2520,8 @@ bool ConstvalNode::IsSameContent(const BaseNode *node) const { } if (constVal->GetKind() == kConstInt) { // integer may differ in primtype, and they may be different MIRIntConst Node - return static_cast(constVal)->GetValue() == static_cast(mirConst)->GetValue(); + return static_cast(constVal)->GetExtValue() == + static_cast(mirConst)->GetExtValue(); } else { return false; } -- Gitee