summaryrefslogtreecommitdiffstats
path: root/execute.c
diff options
context:
space:
mode:
authorNicolas Williams <nico@cryptonector.com>2014-06-23 19:59:00 -0500
committerNicolas Williams <nico@cryptonector.com>2014-06-23 19:59:00 -0500
commitbeb0d081bb158678084c727cfdaef257f9c7b710 (patch)
treecaffa672a372b089c1ec62a02d222f5dfd2a2d15 /execute.c
parent4b7c701fdd3f3e0bbbbe63c5df821f4145ff2b63 (diff)
Improve TCO
Instead of checking for self-recursion check that the thing we're calling is a function and not a closure, therefore the new frame will have the same env as the current frame.
Diffstat (limited to 'execute.c')
-rw-r--r--execute.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/execute.c b/execute.c
index 241b5dad..a1284f98 100644
--- a/execute.c
+++ b/execute.c
@@ -657,7 +657,7 @@ jv jq_next(jq_state *jq) {
uint16_t* retaddr;
struct frame* new_frame;
struct closure cl = make_closure(jq, pc);
- if (nclosures == 0 && *(pc + 2) == RET && frame_current(jq)->bc == cl.bc) {
+ if (nclosures == 0 && *(pc + 2) == RET && *pc == 1) {
// TCO
retaddr = frame_current(jq)->retaddr;
stack_ptr retdata = frame_current(jq)->retdata;