fix some oss-fuzz bugs (#1180)

* fix oss-fuzz 10419.

* fix oss-fuzz 10427.

* fix oss-fuzz 10421.

* fix oss-fuzz 10422.

* fix oss-fuzz 10425.

* fix oss-fuzz 10426.

* fix oss-fuzz 10426.

* fix oss-fuzz 10422.

* fix oss-fuzz  10426.

* fix oss-fuzz 10456.

* fix oss-fuzz 10428.

* fix oss-fuzz 10429.

* fix oss-fuzz 10431.

* fix oss-fuzz 10435.

* fix oss-fuzz 10430.

* fix oss-fuzz 10436.

* remove unused var.
This commit is contained in:
Chen Huitao
2020-01-04 23:42:02 +08:00
committed by Nguyen Anh Quynh
parent 99097cab4c
commit 68eb357984
8 changed files with 17 additions and 17 deletions

View File

@@ -91,7 +91,7 @@ typedef struct {
static int sign_extend(int x, int len)
{
len = 32 - len;
return (x << len) >> len;
return ((int)(((unsigned int)x) << len)) >> len;
}
#define IS_IMM (insn & (1<<13))
@@ -2728,7 +2728,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn, bool hook_ins
break;
case 1: /*CALL*/
{
target_long target = GET_FIELDs(insn, 2, 31) << 2;
target_long target = (int)(((unsigned int)(GET_FIELDs(insn, 2, 31))) << 2);
TCGv o7 = gen_dest_gpr(dc, 15);
tcg_gen_movi_tl(tcg_ctx, o7, dc->pc);