Skip to content

Commit 5a7c7f8

Browse files
committed
Fixed a wrong conditions in riscvdumpregs function. It caused a seg fault when SF_UNCERTAIN_UPE was 0.
1 parent df8995a commit 5a7c7f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sim/machine-riscv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ riscvdumpregs(Engine *E, State *S)
178178
rv32f_rep val;
179179
val.bit_value = (uint32_t)float_bits;
180180
snprintf(fp_value, sizeof(fp_value), "%#.8g", val.float_value);
181-
if (S->riscv->uncertain == NULL || !isnan(S->riscv->uncertain->registers.variances[i]))
181+
if (S->riscv->uncertain != NULL && !isnan(S->riscv->uncertain->registers.variances[i]))
182182
{
183183
size_t start_offset = strlen(fp_value);
184184
snprintf(

0 commit comments

Comments
 (0)