diff mbox

[4/8] tcg: Add some assertions

Message ID 1316289634-18786-4-git-send-email-weil@mail.berlios.de
State Accepted
Headers show

Commit Message

Stefan Weil Sept. 17, 2011, 8 p.m. UTC
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 tcg/tcg.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/tcg/tcg.c b/tcg/tcg.c
index bdd7a67..30f3aef 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 {