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 <f.khaydari@syntacore.com>
This commit is contained in:
Farid Khaydari 2024-11-20 18:12:36 +03:00
parent f51900b4a2
commit c8ae081979
1 changed files with 10 additions and 4 deletions

View File

@ -3427,26 +3427,32 @@ bool is_mem_access_failed(mem_access_result_t status)
{ {
#define MEM_ACCESS_RESULT_HANDLER(name, kind, msg) \ #define MEM_ACCESS_RESULT_HANDLER(name, kind, msg) \
case name: return kind == MEM_ACCESS_RESULT_TYPE_FAILED; case name: return kind == MEM_ACCESS_RESULT_TYPE_FAILED;
switch (status) { switch (status) {
LIST_OF_MEM_ACCESS_RESULTS LIST_OF_MEM_ACCESS_RESULTS
} }
#undef MEM_ACCESS_RESULT_HANDLER #undef MEM_ACCESS_RESULT_HANDLER
LOG_ERROR("Unknown memory access status: %d", status); LOG_ERROR("Unknown memory access status: %d", status);
assert(false); assert(false && "Unknown memory access status");
return false; return true;
} }
bool is_mem_access_skipped(mem_access_result_t status) bool is_mem_access_skipped(mem_access_result_t status)
{ {
#define MEM_ACCESS_RESULT_HANDLER(name, kind, msg) \ #define MEM_ACCESS_RESULT_HANDLER(name, kind, msg) \
case name: return kind == MEM_ACCESS_RESULT_TYPE_SKIPPED; case name: return kind == MEM_ACCESS_RESULT_TYPE_SKIPPED;
switch (status) { switch (status) {
LIST_OF_MEM_ACCESS_RESULTS LIST_OF_MEM_ACCESS_RESULTS
} }
#undef MEM_ACCESS_RESULT_HANDLER #undef MEM_ACCESS_RESULT_HANDLER
LOG_ERROR("Unknown memory access status: %d", status); LOG_ERROR("Unknown memory access status: %d", status);
assert(false); assert(false && "Unknown memory access status");
return false; return true;
} }
const char *mem_access_result_to_str(mem_access_result_t status) const char *mem_access_result_to_str(mem_access_result_t status)