Skip to content

Commit

Permalink
Add missing GC roots in ast.c
Browse files Browse the repository at this point in the history
  • Loading branch information
ihnorton committed Aug 22, 2015
1 parent 0a91769 commit 7aa2dd3
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions src/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,34 +327,48 @@ static jl_value_t *scm_to_julia_(value_t e, int eo)
e = cdr_(e);
if (!eo) {
if (sym == line_sym && n==2) {
jl_value_t *filename = scm_to_julia_(car_(cdr_(e)),0);
jl_value_t *linenum = scm_to_julia_(car_(e),0);
jl_value_t *filename = NULL, *linenum = NULL;
JL_GC_PUSH2(&filename, &linenum);
filename = scm_to_julia_(car_(cdr_(e)),0);
linenum = scm_to_julia_(car_(e),0);
jl_value_t *temp = jl_new_struct(jl_linenumbernode_type,
filename, linenum);
JL_GC_POP();
return temp;
}
jl_value_t *scmv = NULL, *temp = NULL;
JL_GC_PUSH(&scmv);
if (sym == label_sym) {
return jl_new_struct(jl_labelnode_type,
scm_to_julia_(car_(e),0));
scmv = scm_to_julia_(car_(e),0);
temp = jl_new_struct(jl_labelnode_type, scmv);
JL_GC_POP();
return temp;
}
if (sym == goto_sym) {
return jl_new_struct(jl_gotonode_type,
scm_to_julia_(car_(e),0));
scmv = scm_to_julia_(car_(e),0);
temp = jl_new_struct(jl_gotonode_type, scmv);
JL_GC_POP();
return temp;
}
if (sym == inert_sym || (sym == quote_sym && (!iscons(car_(e))))) {
return jl_new_struct(jl_quotenode_type,
scm_to_julia_(car_(e),0));
scmv = scm_to_julia_(car_(e),0);
temp = jl_new_struct(jl_quotenode_type, scmv);
JL_GC_POP();
return temp;
}
if (sym == top_sym) {
return jl_new_struct(jl_topnode_type,
scm_to_julia_(car_(e),0));
scmv = scm_to_julia_(car_(e),0);
temp = jl_new_struct(jl_topnode_type, scmv);
JL_GC_POP();
return temp;
}
if (sym == newvar_sym) {
return jl_new_struct(jl_newvarnode_type,
scm_to_julia_(car_(e),0));
scmv = scm_to_julia_(car_(e),0);
temp = jl_new_struct(jl_newvarnode_type, scmv);
JL_GC_POP();
return temp;
}
JL_GC_POP();
}
else if (sym == inert_sym && !iscons(car_(e))) {
sym = quote_sym;
Expand Down

0 comments on commit 7aa2dd3

Please sign in to comment.