Read about our upcoming Code of Conduct on this issue

This instance was upgraded to Heptapod 0.28.0 today

Commit 0235101c authored by alex@thinkpad's avatar alex@thinkpad
Browse files

QEMU: fixed shift warnings in disas.c

(found with UBSan)

--HG--
branch : qemu
parent 7726454ad704
......@@ -69,6 +69,32 @@ index c88d0ff..4395bb3 100644
}
/* see if we can patch the calling TB. When the TB
spans two pages, we cannot safely do a direct
diff --git a/disas/arm.c b/disas/arm.c
index 7a7354b..95f82cc 100644
--- a/disas/arm.c
+++ b/disas/arm.c
@@ -2826,9 +2826,9 @@ print_insn_arm_internal (bfd_vma pc, struct disassemble_info *info, long given)
if ((given & 0x02000000) != 0)
{
int rotate = (given & 0xf00) >> 7;
- int immed = (given & 0xff);
- immed = (((immed << (32 - rotate))
- | (immed >> rotate)) & 0xffffffff);
+ int64_t immed64 = (given & 0xff);
+ int immed = (((immed64 << (32 - rotate))
+ | (immed64 >> rotate)) & 0xffffffff);
func (stream, "#%d\t; 0x%x", immed, immed);
}
else
@@ -3868,7 +3868,7 @@ int
print_insn_arm (bfd_vma pc, struct disassemble_info *info)
{
unsigned char b[4];
- long given;
+ unsigned long given;
int status;
int is_thumb = false;
int is_data = false;
diff --git a/exec.c b/exec.c
index 0bf0a6e..5eb69de 100644
--- a/exec.c
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment