Skip to content

Commit dc72a44

Browse files
committed
Fix undeclared identifier 'attr' error
Building with 'ENABLE_JIT=1, ENABLE_SYSTEM=1, and ENABLE_ELF_LOADER=0' causes the following errors: src/riscv.c:582:18: error: use of undeclared identifier 'attr' 582 | u8250_delete(attr->uart); | ^ src/riscv.c:583:17: error: use of undeclared identifier 'attr' 583 | plic_delete(attr->plic); | ^ These errors occur because attr is not defined under these conditions. Fix this by adjusting the guard for attr to (RV32_HAS(SYSTEM) && !RV32_HAS(ELF_LOADER)), ensuring it is defined as needed.
1 parent 3b03003 commit dc72a44

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/riscv.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,10 @@ bool rv_has_halted(riscv_t *rv)
621621
void rv_delete(riscv_t *rv)
622622
{
623623
assert(rv);
624-
#if !RV32_HAS(JIT)
624+
#if !RV32_HAS(JIT) || (RV32_HAS(SYSTEM) && !RV32_HAS(ELF_LOADER))
625625
vm_attr_t *attr = PRIV(rv);
626+
#endif
627+
#if !RV32_HAS(JIT)
626628
map_delete(attr->fd_map);
627629
memory_delete(attr->mem);
628630
block_map_destroy(rv);

0 commit comments

Comments
 (0)