Skip to content

Commit c8ae081

Browse files
committed
target/riscv: fix memory access result type checker function return in case of assertion
Fix memory access result type checker return in case of assertion Signed-off-by: Farid Khaydari <[email protected]>
1 parent f51900b commit c8ae081

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
@@ -3427,26 +3427,32 @@ bool is_mem_access_failed(mem_access_result_t status)
34273427
{
34283428
#define MEM_ACCESS_RESULT_HANDLER(name, kind, msg) \
34293429
case name: return kind == MEM_ACCESS_RESULT_TYPE_FAILED;
3430+
34303431
switch (status) {
34313432
LIST_OF_MEM_ACCESS_RESULTS
34323433
}
3434+
34333435
#undef MEM_ACCESS_RESULT_HANDLER
3436+
34343437
LOG_ERROR("Unknown memory access status: %d", status);
3435-
assert(false);
3436-
return false;
3438+
assert(false && "Unknown memory access status");
3439+
return true;
34373440
}
34383441

34393442
bool is_mem_access_skipped(mem_access_result_t status)
34403443
{
34413444
#define MEM_ACCESS_RESULT_HANDLER(name, kind, msg) \
34423445
case name: return kind == MEM_ACCESS_RESULT_TYPE_SKIPPED;
3446+
34433447
switch (status) {
34443448
LIST_OF_MEM_ACCESS_RESULTS
34453449
}
3450+
34463451
#undef MEM_ACCESS_RESULT_HANDLER
3452+
34473453
LOG_ERROR("Unknown memory access status: %d", status);
3448-
assert(false);
3449-
return false;
3454+
assert(false && "Unknown memory access status");
3455+
return true;
34503456
}
34513457

34523458
const char *mem_access_result_to_str(mem_access_result_t status)

0 commit comments

Comments
 (0)