Message ID | 4E0EE837.1000605@web.de |
---|---|
State | New |
Headers | show |
On 07/02/2011 11:43 AM, Jan Kiszka wrote: > static const char *pch; > +static char *saved_key; > static jmp_buf expr_env; > > #define MD_TLONG 0 > @@ -4254,8 +4255,11 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon, > } > typestr++; > } > - if (get_expr(mon,&val,&p)) > + saved_key = key; > + if (get_expr(mon,&val,&p)) { > + key = saved_key; > goto fail; > + } Please make saved_key a volatile local instead. Paolo
diff --git a/monitor.c b/monitor.c index 67ceb46..d7edbbb 100644 --- a/monitor.c +++ b/monitor.c @@ -3253,6 +3253,7 @@ static const mon_cmd_t qmp_query_cmds[] = { /*******************************************************************/ static const char *pch; +static char *saved_key; static jmp_buf expr_env; #define MD_TLONG 0 @@ -4254,8 +4255,11 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon, } typestr++; } - if (get_expr(mon, &val, &p)) + saved_key = key; + if (get_expr(mon, &val, &p)) { + key = saved_key; goto fail; + } /* Check if 'i' is greater than 32-bit */ if ((c == 'i') && ((val >> 32) & 0xffffffff)) { monitor_printf(mon, "\'%s\' has failed: ", cmdname);