summaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2012-12-02 22:12:08 +0000
committerStephen Dolan <mu@netsoc.tcd.ie>2012-12-02 22:12:08 +0000
commitea9db414edd078d8cb5e95a7694df7ae81d6daac (patch)
treec7b349f64d1d648256d4fab1ec50b6b018d7f983 /compile.c
parentb6f2fbbe62be72e7eb52fda9f5ca5a8838869ae4 (diff)
Clean up implementation of builtin functions.
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index b7c202ac..acc89749 100644
--- a/compile.c
+++ b/compile.c
@@ -490,7 +490,8 @@ static block expand_call_arglist(block b) {
block body = i->subfn;
i->subfn = gen_noop();
inst_free(i);
- prelude = BLOCK(prelude, gen_subexp(expand_call_arglist(body)));
+ // arguments should be pushed in reverse order, prepend them to prelude
+ prelude = BLOCK(gen_subexp(expand_call_arglist(body)), prelude);
nargs++;
}
assert(curr->op == CALL_JQ);