From f86f2ab3f8e51129ccadcba4920be0f8bf47637e Mon Sep 17 00:00:00 2001 From: oharboe Date: Thu, 4 Jun 2009 11:42:34 +0000 Subject: [PATCH] use assert() to catch TAP_INVALID passed to jtag_add_xxx() fn's. git-svn-id: svn://svn.berlios.de/openocd/trunk@2043 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/jtag/jtag.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c index 04ab48b6d..5738a0dc4 100644 --- a/src/jtag/jtag.c +++ b/src/jtag/jtag.c @@ -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;