diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 41af8156a..a3381b655 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -3723,6 +3723,12 @@ int riscv013_test_compliance(struct target *target) return ERROR_FAIL; } + if (!target_was_examined(target)) { + LOG_ERROR("Cannot run compliance test, because target has not yet " + "been examined, or the examination failed.\n"); + return ERROR_FAIL; + } + int total_tests = 0; int passed_tests = 0;