Skip to content

Commit e9dcf6b

Browse files
committed
Always pass arguments at full width.
1 parent 063d3be commit e9dcf6b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/vm/moar/QAST/QASTOperationsMAST.nqp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,6 +1323,14 @@ my @kind_to_args := [0,
13231323
sub handle_arg($arg, $qastcomp, @ins, @arg_regs, @arg_flags, @arg_kinds) {
13241324
# generate the code for the arg expression
13251325
my $arg_mast := $qastcomp.as_mast($arg);
1326+
my int $arg_mast_kind := $arg_mast.result_kind;
1327+
if $arg_mast_kind == $MVM_reg_num32 {
1328+
$arg_mast := $qastcomp.coerce($arg_mast, $MVM_reg_num64);
1329+
}
1330+
elsif $arg_mast_kind == $MVM_reg_int32 || $arg_mast_kind == $MVM_reg_int16 ||
1331+
$arg_mast_kind == $MVM_reg_int8 {
1332+
$arg_mast := $qastcomp.coerce($arg_mast, $MVM_reg_int64);
1333+
}
13261334

13271335
nqp::die("arg expression cannot be void")
13281336
if $arg_mast.result_kind == $MVM_reg_void;

0 commit comments

Comments
 (0)