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 27, 2015
1 parent 7bf3449 commit eb867a9
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 eb867a9

Please sign in to comment.