This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Commit: RX SIM: Obvious fix for valid register check


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.

diff --git a/sim/rx/reg.c b/sim/rx/reg.c
index 0fbd4c3..6effe4b 100644
--- a/sim/rx/reg.c
+++ b/sim/rx/reg.c
@@ -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 ();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]