aboutsummaryrefslogtreecommitdiffstats
path: root/cps.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cps.cpp')
-rw-r--r--cps.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/cps.cpp b/cps.cpp
index 3d79b9d..8df11c2 100644
--- a/cps.cpp
+++ b/cps.cpp
@@ -63,7 +63,6 @@ ACall::cps(TEnv& tenv, AST* cont)
// Each makes a tail call to the next, and the last makes a tail
// call to the continuation of this call
ssize_t firstFn = -1;
- ssize_t lastFn = -1;
for (size_t i = 0; i < size(); ++i) {
if (!at(i)->to<ATuple*>()) {
funcs.push_back(make_pair((AFn*)NULL, at(i)));
@@ -77,12 +76,11 @@ ACall::cps(TEnv& tenv, AST* cont)
tup<ATuple>(at(i)->loc, arg, 0),
0);
- if (lastFn != -1)
- fn->push_back(at(lastFn)->cps(tenv, thisFn));
+ if (fn)
+ fn->push_back(at(i)->cps(tenv, thisFn));
funcs.push_back(make_pair(thisFn, arg));
fn = thisFn;
- lastFn = i;
}
}