]> git.sur5r.net Git - openocd/commitdiff
use assert() to catch TAP_INVALID passed to jtag_add_xxx() fn's.
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 4 Jun 2009 11:42:34 +0000 (11:42 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 4 Jun 2009 11:42:34 +0000 (11:42 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@2043 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jtag/jtag.c

index 04ab48b6d6f9e665433e6335f6c8a49ca6396fb5..5738a0dc46df91d1b5ffd4e8a3de69503b7a5572 100644 (file)
@@ -394,8 +394,9 @@ static void jtag_prelude(tap_state_t state)
 {
        jtag_checks();
 
-       if (state != TAP_INVALID)
-               jtag_add_end_state(state);
+       assert(state!=TAP_INVALID);
+
+       jtag_add_end_state(state);
 
        cmd_queue_cur_state = cmd_queue_end_state;
 }
@@ -575,8 +576,9 @@ void jtag_add_dr_out(jtag_tap_t* tap,
                int num_fields, const int* num_bits, const u32* value,
                tap_state_t end_state)
 {
-       if (end_state != TAP_INVALID)
-               cmd_queue_end_state = end_state;
+       assert(end_state != TAP_INVALID);
+
+       cmd_queue_end_state = end_state;
 
        cmd_queue_cur_state = cmd_queue_end_state;