Skip to content

Commit 0f0302b

Browse files
authored
Merge pull request riscv-collab#1174 from fk-sc/fk-sc/checker-fix
target/riscv: fix memory access result type checker function return in case of assertion
2 parents eb1ecd7 + c8ae081 commit 0f0302b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/target/riscv/riscv-013.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3439,26 +3439,32 @@ bool is_mem_access_failed(mem_access_result_t status)
34393439
{
34403440
#define MEM_ACCESS_RESULT_HANDLER(name, kind, msg) \
34413441
case name: return kind == MEM_ACCESS_RESULT_TYPE_FAILED;
3442+
34423443
switch (status) {
34433444
LIST_OF_MEM_ACCESS_RESULTS
34443445
}
3446+
34453447
#undef MEM_ACCESS_RESULT_HANDLER
3448+
34463449
LOG_ERROR("Unknown memory access status: %d", status);
3447-
assert(false);
3448-
return false;
3450+
assert(false && "Unknown memory access status");
3451+
return true;
34493452
}
34503453

34513454
bool is_mem_access_skipped(mem_access_result_t status)
34523455
{
34533456
#define MEM_ACCESS_RESULT_HANDLER(name, kind, msg) \
34543457
case name: return kind == MEM_ACCESS_RESULT_TYPE_SKIPPED;
3458+
34553459
switch (status) {
34563460
LIST_OF_MEM_ACCESS_RESULTS
34573461
}
3462+
34583463
#undef MEM_ACCESS_RESULT_HANDLER
3464+
34593465
LOG_ERROR("Unknown memory access status: %d", status);
3460-
assert(false);
3461-
return false;
3466+
assert(false && "Unknown memory access status");
3467+
return true;
34623468
}
34633469

34643470
const char *mem_access_result_to_str(mem_access_result_t status)

0 commit comments

Comments
 (0)