tcg: Add some assertions
authorStefan Weil <weil@mail.berlios.de>
Sat, 17 Sep 2011 20:00:30 +0000 (22:00 +0200)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 1 Oct 2011 06:11:23 +0000 (06:11 +0000)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tcg/tcg.c

index bdd7a672b32165f34936f14594db175dc018e413..30f3aefe69a2c7899428627bb6d1845fda324211 100644 (file)
--- 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 {