diff options
author | Søren Sandmann <ssp@redhat.com> | 2013-12-23 14:48:14 -0500 |
---|---|---|
committer | Søren Sandmann <ssp@redhat.com> | 2013-12-23 14:48:14 -0500 |
commit | 9cfc52c52fdf61d5c522acd6038aa5d31f2394c2 (patch) | |
tree | 04080b35423cc6ae2e37cb4e9306f021192b57fe | |
parent | 9c77ac187936acbe4ed3acf51686ea6de54dff59 (diff) |
Error checking in free
-rw-r--r-- | regscope.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -224,7 +224,14 @@ reg_alloc_free (reg_alloc_t *ra, reg_t reg) int idx = find_index (ra, reg); reg_status_t *status = &ra->status[idx]; - status->allocated = FALSE; + if (status->spillable) + { + fprintf (stderr, "Attempting to free a spillable register\n"); + return; + } + + if (status->n_spills == 0) + status->allocated = FALSE; } int |