Skip to content

Instantly share code, notes, and snippets.

@FROGGS
Last active December 27, 2015 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FROGGS/c7e950459e834a147cb8 to your computer and use it in GitHub Desktop.
Save FROGGS/c7e950459e834a147cb8 to your computer and use it in GitHub Desktop.
diff --git a/src/vm/moar/QAST/QASTCompilerMAST.nqp b/src/vm/moar/QAST/QASTCompilerMAST.nqp
index 43d4628..999291a 100644
--- a/src/vm/moar/QAST/QASTCompilerMAST.nqp
+++ b/src/vm/moar/QAST/QASTCompilerMAST.nqp
@@ -668,6 +668,14 @@ class QAST::MASTCompiler {
push_op(@pre, 'takeclosure', $reg, $reg);
}
+ if $node.custom_args {
+ # The block does the arg processing by itself, so we accept any number
+ # of args here.
+ push_op(@pre, 'checkarity',
+ MAST::IVal.new( :size(16), :value(0)),
+ MAST::IVal.new( :size(16), :value(-1)));
+ }
+ else {
# Analyze parameters to get count of required/optional and make sure
# all is in order.
my $param_index := 0;
@@ -787,6 +795,7 @@ class QAST::MASTCompiler {
}
$param_index++;
}
+ }
nqp::splice($frame.instructions, @pre, 0, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment