Don't omit the controlling typevar for instructions without results.

The controlling type variable passed to the format constructor in the
InstBuilder trait is not just used to generate the result values. In an
EncCursor, it is also used to encode the instruction, so VOID doesn't
work.
This commit is contained in:
Jakob Stoklund Olesen
2017-10-03 13:37:18 -07:00
parent e10b3117cb
commit 7c023b2430

View File

@@ -572,7 +572,7 @@ def gen_inst_builder(inst, fmt):
if inst.is_polymorphic and not inst.use_typevar_operand: if inst.is_polymorphic and not inst.use_typevar_operand:
# This was an explicit method argument. # This was an explicit method argument.
args.append(inst.ctrl_typevar.name) args.append(inst.ctrl_typevar.name)
elif len(inst.value_results) == 0 or not inst.is_polymorphic: elif not inst.is_polymorphic:
# No controlling type variable needed. # No controlling type variable needed.
args.append('types::VOID') args.append('types::VOID')
else: else: