mirror of
https://github.com/radareorg/radare2.git
synced 2024-10-07 02:23:58 +00:00
Fix last covs
This commit is contained in:
parent
8b796b216d
commit
5a16cbc3b1
@ -92,10 +92,10 @@ static V850NP_INSERT(i5div3) {
|
||||
}
|
||||
|
||||
static V850NP_EXTRACT(i5div3) {
|
||||
unsigned long ret = (insn & 0x003c0000) >> (16+2);
|
||||
st64 ret = (insn & 0x003c0000) >> 18;
|
||||
ret = 32 - (ret * 2);
|
||||
*invalid = (ret > 32 || ret < 2) ? 1 : 0;
|
||||
return ret;
|
||||
*invalid = (ret < 2 || ret > 32);
|
||||
return (ut32)(ret & UT32_MAX);
|
||||
}
|
||||
|
||||
static V850NP_INSERT(d5_4) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <r_util.h>
|
||||
#include "v850e0.h"
|
||||
|
||||
static const char *instrs[] = {
|
||||
static const char * const instrs[] = {
|
||||
[V850_MOV] = "mov",
|
||||
[V850_NOT] = "not",
|
||||
[V850_DIVH] = "divh",
|
||||
@ -53,14 +53,14 @@ static const char *instrs[] = {
|
||||
[V850_EXT1] = "",
|
||||
};
|
||||
|
||||
static const char *bit_instrs[] = {
|
||||
static const char * const bit_instrs[] = {
|
||||
[V850_BIT_SET1] = "set1",
|
||||
[V850_BIT_NOT1] = "not1",
|
||||
[V850_BIT_CLR1] = "clr1",
|
||||
[V850_BIT_TST1] = "tst1",
|
||||
};
|
||||
|
||||
static const char *ext_instrs1[] = {
|
||||
static const char * const ext_instrs1[] = {
|
||||
[V850_EXT_SETF] = "setf",
|
||||
[V850_EXT_LDSR] = "ldsr",
|
||||
[V850_EXT_STSR] = "stsr",
|
||||
@ -73,12 +73,12 @@ static const char *ext_instrs1[] = {
|
||||
[V850_EXT_EXT2] = "ext2",
|
||||
};
|
||||
|
||||
static const char *ext_instrs2[] = {
|
||||
static const char * const ext_instrs2[] = {
|
||||
[V850_EXT_DI] = "di",
|
||||
[V850_EXT_EI] = "ei",
|
||||
};
|
||||
|
||||
static const char *conds[] = {
|
||||
static const char * const conds[] = {
|
||||
[V850_COND_V] = "v",
|
||||
[V850_COND_CL] = "cl",
|
||||
[V850_COND_ZE] = "z",
|
||||
@ -237,9 +237,9 @@ static int decode_bit_op(const ut8 *instr, int len, struct v850_cmd *cmd) {
|
||||
|
||||
ut16 word1 = r_read_le16 (instr);
|
||||
ut16 word2 = r_read_at_le16 (instr, 2);
|
||||
snprintf (cmd->instr, V850_INSTR_MAXLEN - 1, "%s", bit_instrs[word1 >> 14]);
|
||||
snprintf (cmd->instr, sizeof (cmd->instr) - 1, "%s", bit_instrs[word1 >> 14]);
|
||||
ut8 reg1 = get_reg1 (word1);
|
||||
snprintf (cmd->operands, V850_INSTR_MAXLEN - 1, "%u, 0x%x[r%d]",
|
||||
snprintf (cmd->operands, sizeof (cmd->instr) - 1, "%u, 0x%x[r%d]",
|
||||
(word1 >> 11) & 0x7, word2, reg1);
|
||||
return 4;
|
||||
}
|
||||
@ -252,8 +252,11 @@ static int decode_extended(const ut8 *instr, int len, struct v850_cmd *cmd) {
|
||||
ut16 word1 = r_read_le16 (instr);
|
||||
ut16 word2 = r_read_at_le16 (instr, 2);
|
||||
|
||||
snprintf (cmd->instr, V850_INSTR_MAXLEN - 1, "%s",
|
||||
ext_instrs1[get_subopcode (word1)]);
|
||||
int index = get_subopcode (word1);
|
||||
if (index < 0 || index >= R_ARRAY_SIZE (ext_instrs1)) {
|
||||
return -1;
|
||||
}
|
||||
snprintf (cmd->instr, sizeof (cmd->instr) - 1, "%s", ext_instrs1[index]);
|
||||
|
||||
switch (get_subopcode (word1)) {
|
||||
case V850_EXT_SETF:
|
||||
@ -275,8 +278,7 @@ static int decode_extended(const ut8 *instr, int len, struct v850_cmd *cmd) {
|
||||
get_reg1 (word1), get_reg2 (word2));
|
||||
break;
|
||||
case V850_EXT_TRAP:
|
||||
snprintf (cmd->operands, V850_INSTR_MAXLEN - 1, "0x%x",
|
||||
get_reg1 (word1));
|
||||
snprintf (cmd->operands, V850_INSTR_MAXLEN - 1, "0x%x", get_reg1 (word1));
|
||||
break;
|
||||
case V850_EXT_HALT:
|
||||
case V850_EXT_RETI:
|
||||
@ -284,8 +286,7 @@ static int decode_extended(const ut8 *instr, int len, struct v850_cmd *cmd) {
|
||||
break;
|
||||
case V850_EXT_EXT2:
|
||||
// can be only 0 or 1
|
||||
snprintf (cmd->instr, V850_INSTR_MAXLEN - 1, "%s",
|
||||
ext_instrs2[(word2 >> 13) & 1]);
|
||||
snprintf (cmd->instr, V850_INSTR_MAXLEN - 1, "%s", ext_instrs2[(word2 >> 13) & 1]);
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
|
@ -169,8 +169,8 @@ enum v850_flags {
|
||||
struct v850_cmd {
|
||||
ut64 addr;
|
||||
unsigned type;
|
||||
char instr[V850_INSTR_MAXLEN];
|
||||
char operands[V850_INSTR_MAXLEN];
|
||||
char instr[V850_INSTR_MAXLEN];
|
||||
char operands[V850_INSTR_MAXLEN];
|
||||
};
|
||||
|
||||
static inline ut8 get_opcode(const ut16 instr) {
|
||||
|
@ -309,13 +309,9 @@ static int arm_op32(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int le
|
||||
((code[i] & 0xffffff00) == 0xe12fff00)) {
|
||||
op->type = R_ANAL_OP_TYPE_UJMP;
|
||||
} else if (IS_BRANCHL (code[i])) {
|
||||
if (IS_BRANCH (code[i])) {
|
||||
op->type = R_ANAL_OP_TYPE_CALL;
|
||||
op->jump = branch_dst_addr;
|
||||
op->fail = addr + 4;
|
||||
} else {
|
||||
op->type = R_ANAL_OP_TYPE_RET;
|
||||
}
|
||||
op->type = R_ANAL_OP_TYPE_CALL;
|
||||
op->jump = branch_dst_addr;
|
||||
op->fail = addr + 4;
|
||||
} else if (IS_BRANCH (code[i])) {
|
||||
if (IS_CONDAL (code[i])) {
|
||||
op->type = R_ANAL_OP_TYPE_JMP;
|
||||
|
@ -374,7 +374,7 @@ print_insn_lanai (memaddr, info)
|
||||
|
||||
info->data_size = F_DATA_SIZE(opcode->flags);
|
||||
|
||||
if (opcode->flags & (F_UNBR|F_CONDBR|F_JSR))
|
||||
if (opcode->flags & (F_UNBR|F_BR|F_CONDBR|F_JSR))
|
||||
{
|
||||
/* FIXME -- check is_annulled flag */
|
||||
if (opcode->flags & F_UNBR) {
|
||||
|
@ -92,7 +92,7 @@ static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
|
||||
if (op->size == -1) {
|
||||
r_strbuf_set (&op->buf_asm, "(data)");
|
||||
}
|
||||
if (!memcmp (buf, "\xff\xff\xff\xff\xff\xff\xff\xff", op->size)) {
|
||||
if (!memcmp (buf, "\xff\xff\xff\xff\xff\xff\xff\xff", R_MIN (len, op->size))) {
|
||||
r_strbuf_set (&op->buf_asm, "breakpoint");
|
||||
return 4;
|
||||
}
|
||||
|
@ -1,12 +1,6 @@
|
||||
/* Copyright (C) 2008-2021 - pancake, unlogic, emvivre */
|
||||
/* Copyright (C) 2008-2022 - pancake, unlogic, emvivre */
|
||||
|
||||
#include <r_flag.h>
|
||||
#include <r_core.h>
|
||||
#include <r_asm.h>
|
||||
#include <r_lib.h>
|
||||
#include <r_types.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
static ut64 getnum(RAsm *a, const char *s);
|
||||
|
||||
@ -2375,9 +2369,6 @@ static int oppop(RAsm *a, ut8 *data, const Opcode *op) {
|
||||
int offset = 0;
|
||||
int mod = 0;
|
||||
if ((op->operands[0].type & OT_GPREG) && !(op->operands[0].type & OT_MEMORY)) {
|
||||
if (op->operands[0].type & OT_MEMORY) {
|
||||
return -1;
|
||||
}
|
||||
if (op->operands[0].type & OT_REGTYPE & OT_SEGMENTREG) {
|
||||
ut8 base;
|
||||
if (op->operands[0].reg & X86R_FS) {
|
||||
|
@ -1257,7 +1257,7 @@ static int r_cmd_java_handle_calc_flags(RCore *core, const char *cmd) {
|
||||
}
|
||||
|
||||
if (*(cmd) == 'l') {
|
||||
const char *lcmd = *cmd + 1 == ' '? cmd + 2: cmd + 1;
|
||||
const char *lcmd = cmd[1] == ' '? cmd + 2: cmd + 1;
|
||||
IFDBG eprintf ("Seeing %s and accepting %s\n", cmd, lcmd);
|
||||
switch (*(lcmd)) {
|
||||
case 'f':
|
||||
|
@ -104,7 +104,7 @@ R_API ut32 r_time_dos_time_stamp_to_posix(ut32 timeStamp) {
|
||||
t.tm_isdst = -1;
|
||||
time_t epochTime = mktime (&t);
|
||||
|
||||
return (ut32) epochTime;
|
||||
return (ut32) (epochTime & UT32_MAX);
|
||||
}
|
||||
|
||||
R_API bool r_time_stamp_is_dos_format(const ut32 certainPosixTimeStamp, const ut32 possiblePosixOrDosTimeStamp) {
|
||||
|
Loading…
Reference in New Issue
Block a user