ref: db4982b0ed1344608625a91b576a632d89c64ff2
parent: d96227948b1e10f9bb8938e5ba16df794f4a45f4
parent: d49122bb819587aef37e8b76998b654eb78601f8
author: Jeff Bezanson <jeff.bezanson@gmail.com>
date: Thu Jul 13 11:43:18 EDT 2017
Merge pull request #47 from jniewerth/patch-1 gc_handle buf earlier in fl_string to prevent segfaults
--- a/string.c
+++ b/string.c
@@ -126,6 +126,7 @@
if (nargs == 1 && fl_isstring(args[0]))
return args[0];
value_t arg, buf = fl_buffer(NULL, 0);
+ fl_gc_handle(&buf);
ios_t *s = value2c(ios_t*,buf);
uint32_t i;
value_t oldpr = symbol_value(printreadablysym);
@@ -137,7 +138,6 @@
}
set(printreadablysym, oldpr);
set(printprettysym, oldpp);
- fl_gc_handle(&buf);
value_t outp = stream_to_string(&buf);
fl_free_gc_handles(1);
return outp;