Commit: RX SIM: Obvious fix for valid register check
Commit Message
Hi DJ,
I am applying the patch below as an obvious fix for a typo in the
valid register check in sim/rx/reg.c:put_reg(). This bug was reported
in PR 18273 by running a static analyser over the sim sources.
Cheers
Nick
sim/rx/ChangeLog
2015-04-24 Nick Clifton <nickc@redhat.com>
PR sim/18273
* reg.c (put_reg): Fix check for valid register number.
@@ -253,7 +253,7 @@ put_reg (int id, unsigned int v)
}
default:
- if (id >= 1 || id <= 15)
+ if (id >= 1 && id <= 15)
regs.r[id] = v;
else
abort ();