Commit 5291ef6
committed
Fix compiler error with when Zicsr is disabled
When using 'make ENABLE_Zicsr=0', the following error is observed:
src/emulate.c:561:10: error: ‘rv_insn_csrrw’ undeclared (first use in this function); did you mean ‘rv_insn_csrai’?
561 | case rv_insn_csrrw:
| ^~~~~~~~~~~~~
| rv_insn_csrai
The error occurs because CSR instruction enums are only defined when
the Zicsr extension is enabled. By adding the feature guard, we ensure
the switch cases are only compiled when the required instruction
definitions are available.1 parent 7516ee4 commit 5291ef6
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
| 561 | + | |
561 | 562 | | |
| 563 | + | |
562 | 564 | | |
563 | 565 | | |
564 | 566 | | |
| |||
0 commit comments