1 Star 0 Fork 67

linwei9/binutils

forked from src-openEuler/binutils 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Prevent-a-left-shift-by-a-negative-value-when-disassembling.patch 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
dogsheng 提交于 2019-12-25 15:42 +08:00 . Package init
From 993a00a986d0795a3cbb7a2dd0c640d8e6d66734 Mon Sep 17 00:00:00 2001
From: Nick Clifton <nickc@redhat.com>
Date: Tue, 29 Oct 2019 10:01:27 +0000
Subject: [PATCH] Prevent a left shift by a negative value when disassembling
IA64 binaries.
* ia64-opc.c (locate_opcode_ent): Prevent a negative shift when
locating the bit to be tested.
---
opcodes/ia64-opc.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/opcodes/ia64-opc.c b/opcodes/ia64-opc.c
index 5aa1198..ba60f8a 100644
--- a/opcodes/ia64-opc.c
+++ b/opcodes/ia64-opc.c
@@ -372,13 +372,16 @@ locate_opcode_ent (ia64_insn opcode, enum ia64_insn_type type)
bitpos[currstatenum] = currbitnum;
- /* Skip opval[0] bits in the instruction. */
+ /* Skip opval[0] bits in the instruction. */
if (op & 0x40)
{
currbitnum -= opval[0];
}
- /* The value of the current bit being tested. */
+ if (currbitnum < 0)
+ currbitnum = 0;
+
+ /* The value of the current bit being tested. */
currbit = opcode & (((ia64_insn) 1) << currbitnum) ? 1 : 0;
next_op = -1;
@@ -463,7 +466,7 @@ locate_opcode_ent (ia64_insn opcode, enum ia64_insn_type type)
if (next_op > 65535)
{
- abort ();
+ return -1;
}
/* Run through the list of opcodes to check, trying to find
--
2.9.3
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/linwei9/binutils.git
git@gitee.com:linwei9/binutils.git
linwei9
binutils
binutils
master

搜索帮助