From: Stefan Weil Date: Sat, 17 Sep 2011 20:00:30 +0000 (+0200) Subject: tcg: Add some assertions X-Git-Tag: v1.0-rc0~172 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f6f0ae5b95adfa76e10eabe2c34424a955fd10c;p=thirdparty%2Fqemu.git tcg: Add some assertions Signed-off-by: Stefan Weil Signed-off-by: Blue Swirl --- diff --git a/tcg/tcg.c b/tcg/tcg.c index bdd7a672b32..30f3aefe69a 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -794,7 +794,9 @@ static char *tcg_get_arg_str_idx(TCGContext *s, char *buf, int buf_size, { TCGTemp *ts; + assert(idx >= 0 && idx < s->nb_temps); ts = &s->temps[idx]; + assert(ts); if (idx < s->nb_globals) { pstrcpy(buf, buf_size, ts->name); } else {