From nobody Sun May 5 01:02:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+68458+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+68458+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1607432981; cv=none; d=zohomail.com; s=zohoarc; b=UH9bbUSBOcX7Hy9wN8Tk3VPgaARsFG3AzuOb12veCSyJ4igG8L37jJMFJDGZukR3xaueTyxg8y4mWPxH3ZbPC4QWv6VPme1kYpXbMPytoS1c4U36cD4fpdFCvNWkKds+YmKLECfYd09nHDNnUSydfemh0bDfOxlIYB7pfGcrksY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607432981; h=Content-Type:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ihQnft1tf5/NB4benSA1VEJBrivpaWghQxilReKMozs=; b=BeIQ2rPKUQMzi5sFPiIi6lhy5myNbTNLocODCXK1QurMtFAZDnl7wqn4lhHcRpKTQZ6xSfC9VJ9GHZSDEfBbN+R2nKqQkOnA7S29qN5vi2gtCyyVQQa7xycu2lIsPK91OlT0dehe/xWoaPor9C9T+YrclV8vdF41saWeh6/OjGs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+68458+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1607432981409988.6809881104939; Tue, 8 Dec 2020 05:09:41 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id oT4SYY1788612x5BJqPgEs3s; Tue, 08 Dec 2020 05:09:41 -0800 X-Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by mx.groups.io with SMTP id smtpd.web11.8024.1607432979830761779 for ; Tue, 08 Dec 2020 05:09:40 -0800 X-Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4Cr0r04Mykz79pT; Tue, 8 Dec 2020 21:09:04 +0800 (CST) X-Received: from HGH1000039998.huawei.com (10.184.68.188) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Tue, 8 Dec 2020 21:09:28 +0800 From: "wenyi,xie via groups.io" To: , , CC: , Subject: [edk2-devel] [PATCH EDK2 v1 1/1] ArmPkg/ArmDisassemblerLib: fix incorrect comparison Date: Tue, 8 Dec 2020 21:07:49 +0800 Message-ID: <1607432869-13641-2-git-send-email-xiewenyi2@huawei.com> In-Reply-To: <1607432869-13641-1-git-send-email-xiewenyi2@huawei.com> References: <1607432869-13641-1-git-send-email-xiewenyi2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.184.68.188] X-CFilter-Loop: Reflected Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,xiewenyi2@huawei.com X-Gm-Message-State: teV6DIlJJWwrmJXF902PCJojx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1607432981; bh=GMpjjpv/9D68i6uX8nHbVb/ak4U6+pwNXrBBKIMjJzE=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=BJEyQWZG/4z5MNWJIdqhmijGY0TuW/8oY9yNVGkq3KhwzRcHY+CXuCg3YSmOZa4DMFx Xe5AwDEkJ7GdIT5C9qW77bsBaH0mCPAOn57bhSUBW/hCacSwGIcHcFK/SoAcpa31m79PM FB6yyO0DLSzG98gENAl52pGjVASyyS1Q9Nw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" As shift =3D (OpCode >> 5) & 0x3, shift will never be larger than 0x3, so the comparison between shift and 0x12 will always be false. The right shift type of ASR is 0x2. Cc: Leif Lindholm Cc: Ard Biesheuvel Signed-off-by: Wenyi Xie Reviewed-by: Leif Lindholm --- ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c b/ArmPkg/L= ibrary/ArmDisassemblerLib/ArmDisassembler.c index b4f0f8dbbfc9..d206cf4ea908 100644 --- a/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c +++ b/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c @@ -240,7 +240,7 @@ DisassembleArmInstruction ( if (shift_imm =3D=3D 0) { shift_imm =3D 32; } - } else if (shift =3D=3D 0x12) { + } else if (shift =3D=3D 0x2) { Type =3D "ASR"; } else if (shift_imm =3D=3D 0) { AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a%a, %a, RRX]%a"= , gReg[Rn], SIGN (U), gReg[Rm], WRITE (W)); @@ -270,7 +270,7 @@ DisassembleArmInstruction ( if (shift_imm =3D=3D 0) { shift_imm =3D 32; } - } else if (shift =3D=3D 0x12) { + } else if (shift =3D=3D 0x2) { Type =3D "ASR"; } else if (shift_imm =3D=3D 0) { AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a%a, %a, RRX", = gReg[Rn], SIGN (U), gReg[Rm]); --=20 2.20.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#68458): https://edk2.groups.io/g/devel/message/68458 Mute This Topic: https://groups.io/mt/78802483/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-