mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 21:29:49 +00:00
Mark java tests as broken until the arch refactor is done ##arch
This commit is contained in:
parent
5ab9a6f002
commit
b1c1219886
@ -176,7 +176,8 @@ static bool decode(RArchSession *as, RAnalOp *op, RAnalOpMask mask) {
|
||||
// get opcode size
|
||||
if (len < 1) {
|
||||
op->type = R_ANAL_OP_TYPE_ILL;
|
||||
return true; // XXX return false; ?
|
||||
op->size = 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
ut8 op_byte = data[0];
|
||||
@ -197,7 +198,7 @@ static bool decode(RArchSession *as, RAnalOp *op, RAnalOpMask mask) {
|
||||
// handle lookup and table switch offsets
|
||||
if (op_byte == 0xaa || op_byte == 0xab) {
|
||||
java_switch_op (as, op, addr, data, len);
|
||||
// IN_SWITCH_OP = 1;
|
||||
// IN_SWITCH_OP = true;
|
||||
}
|
||||
|
||||
if (mask & R_ARCH_OP_MASK_DISASM) {
|
||||
@ -258,7 +259,7 @@ static bool decode(RArchSession *as, RAnalOp *op, RAnalOpMask mask) {
|
||||
op->stackop = R_ANAL_STACK_INC;
|
||||
op->stackptr = 8;
|
||||
}
|
||||
op->direction = R_ANAL_OP_DIR_EXEC;
|
||||
op->direction = R_ANAL_OP_DIR_EXEC;
|
||||
if (op->type == R_ANAL_OP_TYPE_PUSH) {
|
||||
op->stackop = R_ANAL_STACK_INC;
|
||||
op->stackptr = -8;
|
||||
@ -287,7 +288,6 @@ static bool encode(RArchSession *as, RAnalOp *op, ut32 mask) {
|
||||
op->size = size;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ static int enter_switch_op(ut64 addr, const ut8 * bytes, int len);
|
||||
static int update_switch_op(ut64 addr, const ut8 * bytes);
|
||||
static int update_bytes_consumed(int sz);
|
||||
|
||||
static R_TH_LOCAL ut8 IN_SWITCH_OP = 0;
|
||||
static R_TH_LOCAL bool IN_SWITCH_OP = false;
|
||||
|
||||
typedef struct current_table_switch_t {
|
||||
ut64 addr;
|
||||
@ -53,7 +53,7 @@ static int enter_switch_op(ut64 addr, const ut8* bytes, int len) {
|
||||
sz2, BYTES_CONSUMED, sz);
|
||||
}
|
||||
init_switch_op ();
|
||||
IN_SWITCH_OP = 1;
|
||||
IN_SWITCH_OP = true;
|
||||
SWITCH_OP.addr = addr;
|
||||
SWITCH_OP.def_jmp = (UINT (bytes, sz));
|
||||
SWITCH_OP.min_val = (UINT (bytes, sz + 4));
|
||||
@ -86,7 +86,7 @@ static int update_switch_op(ut64 addr, const ut8 * bytes) {
|
||||
}
|
||||
int ccase = SWITCH_OP.cur_val + SWITCH_OP.min_val;
|
||||
if (ccase + 1 > SWITCH_OP.max_val) {
|
||||
IN_SWITCH_OP = 0;
|
||||
IN_SWITCH_OP = false;
|
||||
}
|
||||
R_LOG_DEBUG ("Addr approach: 0x%04"PFMT64x" and BYTES_CONSUMED approach: 0x%04"PFMT64x, addr, BYTES_CONSUMED);
|
||||
return update_bytes_consumed (sz);
|
||||
@ -293,7 +293,7 @@ R_API int java_print_opcode(RBinJavaObj *obj, ut64 addr, int idx, const ut8 *byt
|
||||
R_API void r_java_new_method(void) {
|
||||
IFDBG eprintf ("Reseting the bytes consumed, they were: 0x%04"PFMT64x".\n", BYTES_CONSUMED);
|
||||
init_switch_op ();
|
||||
IN_SWITCH_OP = 0;
|
||||
IN_SWITCH_OP = false;
|
||||
BYTES_CONSUMED = 0;
|
||||
}
|
||||
|
||||
|
@ -484,10 +484,12 @@ if_icmplt 0x0007
|
||||
iload_1
|
||||
ireturn
|
||||
EOF
|
||||
BROKEN=1
|
||||
RUN
|
||||
|
||||
NAME=java simple switch statement 3 values no breaks
|
||||
FILE=malloc://128
|
||||
BROKEN=1
|
||||
CMDS=<<EOF
|
||||
e asm.arch=java
|
||||
wx 033b043ca7002c1a08703d1caa0000000000001e0000000000000001000000180000001b8402fe8402ff033c1b1c823c1a100aa1ffd41bac00000003000a0000
|
||||
@ -523,8 +525,10 @@ ireturn
|
||||
EOF
|
||||
RUN
|
||||
|
||||
BROKEN=1
|
||||
NAME=java simple switch statement 4 values
|
||||
FILE=malloc://128
|
||||
BROKEN=1
|
||||
CMDS=<<EOF
|
||||
e asm.arch=java
|
||||
wx 033b033ca7003c1a08703d1caa0000000000003200000000000000030000002000000026000000320000002c840202a70011840203a7000b840209a70005033c1a100aa1ffc41bac00000003000a0000
|
||||
@ -599,4 +603,5 @@ if_icmplt 0x0007
|
||||
iload_1
|
||||
ireturn
|
||||
EOF
|
||||
BROKEN=1
|
||||
RUN
|
||||
|
Loading…
Reference in New Issue
Block a user