Skip to content

Commit

Permalink
traced one segfault, but that's just a symptom and not the source...
Browse files Browse the repository at this point in the history
  • Loading branch information
EffinMaggie committed Mar 6, 2010
1 parent 4f313ed commit 03ec2bd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
core
*.o
html-*
rtf-*
Expand Down
29 changes: 23 additions & 6 deletions src/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ static void on_death_respawn (struct exec_context *ctx, void *u)
struct termination_meta *cur = termination_meta;
struct termination_meta **p = &termination_meta;
int respawn = ~0;
sexpr continuations = sx_end_of_list;

free_exec_context (ctx);

Expand Down Expand Up @@ -219,23 +220,39 @@ static void on_death_respawn (struct exec_context *ctx, void *u)
{
if (falsep (sx_set_rx_memberp (running_processes, cur->regex)))
{
struct machine_state *stu
= (struct machine_state *)(cur->continuation);
if (!mstatep (cur->continuation))
{
#warning fix the source of this state corruption and then remove this warning
kyu_command (make_string("state curruption, expected continuation, but have"));
kyu_command (cur->continuation);
}
else
{
continuations = cons (cur->continuation, continuations);
}

*p = cur->next;
cur = *p;

lx_continue
(lx_make_state (cons (sx_true, sx_end_of_list),
stu->environment, stu->code, stu->dump));

continue;
}

p = &(cur->next);
cur = cur->next;
}

while (consp (continuations))
{
struct machine_state *stu
= (struct machine_state *)(car (continuations));

lx_continue
(lx_make_state (cons (sx_true, sx_end_of_list),
stu->environment, stu->code, stu->dump));

continuations = cdr (continuations);
}

if (respawn)
{
kyu_sc_keep_alive ((sexpr)u, (void *)sx_end_of_list);
Expand Down

0 comments on commit 03ec2bd

Please sign in to comment.