summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-02-29 21:43:19 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-02-29 21:43:19 +0000
commit4cb9b179059bb40badde110da5641dcbbd636a29 (patch)
treedf55796215f47ccdaf974c39fbb633e26f81fc79 /src
parent269aa8e99af515b95a27f46286988cfd69d967a5 (diff)
downloadopenocd_libswd-4cb9b179059bb40badde110da5641dcbbd636a29.tar.gz
openocd_libswd-4cb9b179059bb40badde110da5641dcbbd636a29.tar.bz2
openocd_libswd-4cb9b179059bb40badde110da5641dcbbd636a29.tar.xz
openocd_libswd-4cb9b179059bb40badde110da5641dcbbd636a29.zip
fixed stack corruption. Introduced when _check_value was phased out.
git-svn-id: svn://svn.berlios.de/openocd/trunk@403 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r--src/target/xscale.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/target/xscale.c b/src/target/xscale.c
index fdb12304..8f7d8351 100644
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -291,8 +291,6 @@ int xscale_read_dcsr(target_t *target)
fields[1].in_check_value = NULL;
fields[1].in_check_mask = NULL;
-
-
fields[2].device = xscale->jtag_info.chain_pos;
fields[2].num_bits = 1;
fields[2].out_value = &field2;
@@ -322,11 +320,16 @@ int xscale_read_dcsr(target_t *target)
jtag_add_dr_scan(3, fields, -1);
- return ERROR_OK;
+ /* DANGER!!! this must be here. It will make sure that the arguments
+ * to jtag_set_check_value() does not go out of scope! */
+ return jtag_execute_queue();
}
int xscale_receive(target_t *target, u32 *buffer, int num_words)
{
+ if (num_words==0)
+ return ERROR_INVALID_ARGUMENTS;
+
int retval=ERROR_OK;
armv4_5_common_t *armv4_5 = target->arch_info;
xscale_common_t *xscale = armv4_5->arch_info;