summaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
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);