From 7c023b24306ea0081e5cdd9bf62c4d1f6827bdce Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Tue, 3 Oct 2017 13:37:18 -0700 Subject: [PATCH] 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. --- lib/cretonne/meta/gen_instr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cretonne/meta/gen_instr.py b/lib/cretonne/meta/gen_instr.py index 3b43ad368b..b004aaadf1 100644 --- a/lib/cretonne/meta/gen_instr.py +++ b/lib/cretonne/meta/gen_instr.py @@ -572,7 +572,7 @@ def gen_inst_builder(inst, fmt): if inst.is_polymorphic and not inst.use_typevar_operand: # This was an explicit method argument. 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. args.append('types::VOID') else: