We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8a2adf commit b0f7b65Copy full SHA for b0f7b65
src/emulate.c
@@ -144,9 +144,9 @@ static uint32_t *csr_get_ptr(riscv_t *rv, uint32_t csr)
144
145
/* Machine Counter/Timers */
146
case CSR_CYCLE: /* Cycle counter for RDCYCLE instruction */
147
- return (uint32_t *) (&rv->csr_cycle) + 0;
+ return &((uint32_t *) &rv->csr_cycle)[0];
148
case CSR_CYCLEH: /* Upper 32 bits of cycle */
149
- return (uint32_t *) (&rv->csr_cycle) + 1;
150
151
/* TIME/TIMEH - very roughly about 1 ms per tick */
152
case CSR_TIME: { /* Timer for RDTIME instruction */
0 commit comments