Skip to content

Commit 1051835

Browse files
committed
Don't immediately segfault with -rtos on v0.11.
1 parent ccdd26e commit 1051835

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/target/riscv/riscv.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,9 @@ bool riscv_rtos_enabled(const struct target *target)
10121012
void riscv_set_current_hartid(struct target *target, int hartid)
10131013
{
10141014
RISCV_INFO(r);
1015+
if (!r->select_current_hart)
1016+
return;
1017+
10151018
int previous_hartid = riscv_current_hartid(target);
10161019
r->current_hartid = hartid;
10171020
assert(riscv_rtos_enabled(target) || target->coreid == hartid);

0 commit comments

Comments
 (0)