Let jtag_call_event_callbacks() behave when the callback removes itself.
Oddly, this crashed on x86_32 but not x86_64.
---
 src/jtag/core.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Let jtag_call_event_callbacks() behave when the callback removes itself.
Oddly, this crashed on x86_32 but not x86_64.
---
 src/jtag/core.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -282,8 +282,12 @@ int jtag_call_event_callbacks(enum jtag_
 
 	while (callback)
 	{
+		jtag_event_callback_t *next;
+
+		/* callback may remove itself */
+		next = callback->next;
 		callback->callback(event, callback->priv);
-		callback = callback->next;
+		callback = next;
 	}
 
 	return ERROR_OK;
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to