From: "Leif Lindholm" <leif@nuviainc.com>
To: devel@edk2.groups.io, xiewenyi2@huawei.com
Cc: ard.biesheuvel@arm.com, songdongkuang@huawei.com
Subject: Re: [edk2-devel] [PATCH EDK2 v1 1/1] ArmPkg/ArmDisassemblerLib: fix incorrect comparison
Date: Tue, 8 Dec 2020 13:59:45 +0000 [thread overview]
Message-ID: <20201208135945.GK1664@vanye> (raw)
In-Reply-To: <1607432869-13641-2-git-send-email-xiewenyi2@huawei.com>
On Tue, Dec 08, 2020 at 21:07:49 +0800, wenyi,xie via groups.io wrote:
> As shift = (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.
Whoops[tm].
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
Pushed as 8e4cb8fbceb8.
Thanks!
> ---
> ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c b/ArmPkg/Library/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 == 0) {
> shift_imm = 32;
> }
> - } else if (shift == 0x12) {
> + } else if (shift == 0x2) {
> Type = "ASR";
> } else if (shift_imm == 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 == 0) {
> shift_imm = 32;
> }
> - } else if (shift == 0x12) {
> + } else if (shift == 0x2) {
> Type = "ASR";
> } else if (shift_imm == 0) {
> AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a%a, %a, RRX", gReg[Rn], SIGN (U), gReg[Rm]);
> --
> 2.20.1.windows.1
>
>
>
>
>
>
prev parent reply other threads:[~2020-12-08 13:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-08 13:07 [PATCH EDK2 v1 0/1] ArmPkg/ArmDisassemblerLib: fix incorrect comparison wenyi,xie
2020-12-08 13:07 ` [PATCH EDK2 v1 1/1] " wenyi,xie
2020-12-08 13:59 ` Leif Lindholm [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201208135945.GK1664@vanye \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox