[ssa] Fix an assertion if the buffer used to keep renaming history gets full.
authorZoltan Varga <vargaz@gmail.com>
Mon, 13 Feb 2017 19:34:59 +0000 (14:34 -0500)
committerZoltan Varga <vargaz@gmail.com>
Mon, 13 Feb 2017 19:35:51 +0000 (14:35 -0500)
mono/mini/ssa.c

index d70788c6afb39ce430fcde647838b3ca7689e66b..d0b34b2781d177be5a558e56491edf369130ba84 100644 (file)
@@ -238,8 +238,13 @@ mono_ssa_rename_vars (MonoCompile *cfg, int max_vars, MonoBasicBlock *bb, gboole
                                if (var->opcode == OP_ARG)
                                        originals_used [idx] = TRUE;
 
-                               /* FIXME: */
-                               g_assert (stack_history_len < stack_history_size);
+                               if (stack_history_len + 128 > stack_history_size) {
+                                       stack_history_size += 1024;
+                                       RenameInfo *new_history = mono_mempool_alloc (cfg->mempool, sizeof (RenameInfo) * stack_history_size);
+                                       memcpy (new_history, stack_history, stack_history_len * sizeof (RenameInfo));
+                                       stack_history = new_history;
+                               }
+
                                stack_history [stack_history_len].var = stack [idx];
                                stack_history [stack_history_len].idx = idx;
                                stack_history_len ++;