diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-01-10 08:44:00 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-01-10 08:44:00 -0800 |
commit | 866c357da7ef1a2cb45290cb11ef91eb57b10169 (patch) | |
tree | 5030c70a084ccc9beb08d69834ae6d0790c8a52f /lib.c | |
parent | d0c3ee7233765e807cf4c8a0615245ac6dcf8996 (diff) | |
download | txr-866c357da7ef1a2cb45290cb11ef91eb57b10169.tar.gz txr-866c357da7ef1a2cb45290cb11ef91eb57b10169.tar.bz2 txr-866c357da7ef1a2cb45290cb11ef91eb57b10169.zip |
GC-correct order in copy_lazy_str.
* lib.c (copy_lazy_str): Eliminate pointless initialization of ls.list
and to nil. Make ls.prefix initialization the last step since
it's the only operation which conses.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -6135,12 +6135,12 @@ static val copy_lazy_str(val lstr) { val obj = make_obj(); obj->ls.type = LSTR; - obj->ls.list = obj->ls.prefix = nil; - obj->ls.prefix = copy_str(lstr->ls.prefix); + obj->ls.prefix = nil; obj->ls.list = lstr->ls.list; obj->ls.props = coerce(struct lazy_string_props *, chk_copy_obj(coerce(mem_t *, lstr->ls.props), sizeof *lstr->ls.props)); + obj->ls.prefix = copy_str(lstr->ls.prefix); return obj; } |