# HG changeset patch # User Mario de Sousa # Date 1349979395 -3600 # Node ID 59fc28d4b06c4715aee421cd98a30e2054fb7236 # Parent b221168a36f16b8d9fbe5154e181343dea6fde61 Fix bug related to support of SAFE datatypes. diff -r b221168a36f1 -r 59fc28d4b06c stage3/narrow_candidate_datatypes.cc --- a/stage3/narrow_candidate_datatypes.cc Sun Oct 07 09:45:54 2012 +0100 +++ b/stage3/narrow_candidate_datatypes.cc Thu Oct 11 19:16:35 2012 +0100 @@ -863,15 +863,17 @@ set_datatype_in_prev_il_instructions(prev_instruction_type, fake_prev_il_instruction); /* set the datatype for the operand */ il_operand->datatype = operand_type; + il_operand->accept(*this); - count ++; + /* NOTE: DO NOT search any further! Return immediately! + * Since we support SAFE*** datatypes, multiple entries in the widen_table may be compatible. + * If we try to set more than one distinct datatype on the same symbol, then the datatype will be set to + * an invalid_datatype, which is NOT what we want! + */ + return NULL; } } } -// if (count > 1) ERROR; /* Since we also support SAFE data types, this assertion is not necessarily always tru! */ - if (is_type_valid(symbol->datatype) && (count <= 0)) ERROR; - - il_operand->accept(*this); return NULL; }