Fix logic bug in requires_typevar_operand.

The Python code computing this property had a bug. The property has only
been used for optimizing the ctrl_typevar() method so far.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-14 13:31:01 -07:00
parent 7db4b1b73a
commit d604855b27
2 changed files with 14 additions and 1 deletions

View File

@@ -445,7 +445,7 @@ def gen_type_constraints(fmt, instrs):
use_typevar_operand = i.is_polymorphic and i.use_typevar_operand
# Can the controlling type variable be inferred from the result?
use_result = (fixed_results > 0 and
i.outs[i.value_results[0]].typevar != ctrl_typevar)
i.outs[i.value_results[0]].typevar == ctrl_typevar)
# Are we required to use the designated operand instead of the
# result?
requires_typevar_operand = use_typevar_operand and not use_result