diff options
author | Tim Newsome <tim@sifive.com> | 2017-06-19 12:23:38 -0700 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2017-06-20 11:32:42 -0700 |
commit | 10518351bb4208545f8b80c7c8e21b7585fe0925 (patch) | |
tree | b68c536b45144d06aba0be0f5790bc7089552ef9 /src | |
parent | ccdd26e3ef8309e26fcda3581ce87dc4eaeb37b2 (diff) | |
download | riscv-openocd-10518351bb4208545f8b80c7c8e21b7585fe0925.zip riscv-openocd-10518351bb4208545f8b80c7c8e21b7585fe0925.tar.gz riscv-openocd-10518351bb4208545f8b80c7c8e21b7585fe0925.tar.bz2 |
Don't immediately segfault with -rtos on v0.11.
Diffstat (limited to 'src')
-rw-r--r-- | src/target/riscv/riscv.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 31a6db6..7a40467 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -1012,6 +1012,9 @@ bool riscv_rtos_enabled(const struct target *target) void riscv_set_current_hartid(struct target *target, int hartid) { RISCV_INFO(r); + if (!r->select_current_hart) + return; + int previous_hartid = riscv_current_hartid(target); r->current_hartid = hartid; assert(riscv_rtos_enabled(target) || target->coreid == hartid); |