commit e50838f9200c0ce9d73053aa853a81e70edce971
parent d572461126849761506f507c9281157dd63e2c0b
Author: Andres Navarro <canavarro82@gmail.com>
Date: Fri, 29 Apr 2011 16:39:06 -0300
Added source code info copying to check_copy_list & check_copy_ptree.
Diffstat:
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/kgenv_mut.h b/src/kgenv_mut.h
@@ -156,6 +156,10 @@ inline TValue check_copy_ptree(klisp_State *K, char *name, TValue ptree,
/* create a new pair as copy, save it in the mark */
TValue new_pair = kimm_cons(K, KNIL, KNIL);
kset_mark(top, new_pair);
+ /* copy the source code info */
+ TValue si = ktry_get_si(K, top);
+ if (!ttisnil(si))
+ kset_source_info(K, new_pair, si);
}
/* keep the old pair and continue with the car */
ks_tbpush(K, ST_CAR);
diff --git a/src/kghelpers.h b/src/kghelpers.h
@@ -303,6 +303,10 @@ inline TValue check_copy_list(klisp_State *K, char *name, TValue obj,
TValue new_pair = kcons(K, kcar(tail), KNIL);
/* record the corresponding pair to simplify cycle handling */
kset_mark(tail, new_pair);
+ /* copy the source code info */
+ TValue si = ktry_get_si(K, tail);
+ if (!ttisnil(si))
+ kset_source_info(K, new_pair, si);
kset_cdr(last_pair, new_pair);
last_pair = new_pair;
tail = kcdr(tail);