Avoid freeing an operand twice.

Due to the way operands are used, they can be freed twice in dead-statement
removal. Detect the double-free and ignore it.
This commit is contained in:
Bill Currie 2011-03-06 11:18:19 +09:00
parent 28f4de94d2
commit 17a9dff769

View file

@ -182,6 +182,12 @@ new_operand (op_type_e op)
static void
free_operand (operand_t *op)
{
if (op->next) {
//FIXME this should be an error, but due to the way operands are use,
//it can happen.
debug (0, "free_operand: double free");
return;
}
op->next = free_operands;
free_operands = op;
}