tests: add sanity check on insn->detail, since it can be NULL when SKIPDATA option is ON
diff --git a/tests/test_ppc.c b/tests/test_ppc.c
index 548e0c5..7620a11 100644
--- a/tests/test_ppc.c
+++ b/tests/test_ppc.c
@@ -30,8 +30,13 @@
static void print_insn_detail(cs_insn *ins)
{
- cs_ppc *ppc = &(ins->detail->ppc);
+ cs_ppc *ppc;
+ // detail can be NULL on "data" instruction if SKIPDATA option is turned ON
+ if (ins->detail == NULL)
+ return;
+
+ ppc = &(ins->detail->ppc);
if (ppc->op_count)
printf("\top_count: %u\n", ppc->op_count);