aboutsummaryrefslogtreecommitdiff
path: root/test/test-td-simple.c
diff options
context:
space:
mode:
authorcomex2015-02-08 23:57:10 -0500
committercomex2015-02-08 23:57:47 -0500
commit73d3b8db5cb3298db4054e30e809b4271b0f9fb3 (patch)
treed0b789f4a2d82678c0a557c180e01d1ab3385af2 /test/test-td-simple.c
parentRefactor disassembly so x86 works, and add x86 transform-dis. (diff)
downloadsubstitute-73d3b8db5cb3298db4054e30e809b4271b0f9fb3.tar.gz
Fix other architectures compiling - haven't tried *running* anything..
Diffstat (limited to '')
-rw-r--r--test/test-td-simple.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/test-td-simple.c b/test/test-td-simple.c
index 6478b46..fdcb286 100644
--- a/test/test-td-simple.c
+++ b/test/test-td-simple.c
@@ -21,16 +21,16 @@ static void P_pcrel(UNUSED struct tc *ctx, uint32_t dpc,
NOINLINE UNUSED
static void P_data(UNUSED struct tc *ctx, unsigned o0, unsigned o1, unsigned o2,
unsigned o3, unsigned out_mask) {
- printf("data\n", ctx->op);
+ printf("data\n");
unsigned os[] = {o0, o1, o2, o3};
for(size_t i = 0; i < 4; i++) {
unsigned val = os[i];
if(val == -1u)
break;
printf(" reg %x: %s\n", val, out_mask & (1 << i) ? "out" : "in");
- ctx->newval[i] = i;
+ ctx->base.newval[i] = i;
}
- ctx->modify = true;
+ ctx->base.modify = true;
}
NOINLINE UNUSED
static void P_pcrel(UNUSED struct tc *ctx, uint32_t dpc,
@@ -100,11 +100,11 @@ int main(UNUSED int argc, char **argv) {
#else
uint32_t op = strtoll(op_str ? op_str : "deadbeef", NULL, 16);
ctx.base.ptr = &op;
- ctx.base.newop = 0;
+ memset(ctx.base.newop, 0, sizeof(ctx.base.newop));
ctx.base.modify = false;
printf("%08x: ", op);
P_(xdis)(&ctx);
- printf("==> %x (size=%d)\n", ctx.base.newop, ctx.base.op_size);
+ printf("==> %x (size=%d)\n", *(uint32_t *) ctx.base.newop, ctx.base.op_size);
#endif
}