summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-06-13 13:20:39 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-06-13 13:20:39 -0700
commit844707a0f077589fc9fbb151d1c4f22bef750401 (patch)
treec383dba41c50c221e813a9b40320e75f47d92732 /ext
parent7a1f2b7c9de07c25046be344ff438048e707a3e3 (diff)
downloadffi-yajl-844707a0f077589fc9fbb151d1c4f22bef750401.tar.gz
mark the 'ctx' variable as volatile
this should avoid compiler optimizations that might interfere with the garbage collector later
Diffstat (limited to 'ext')
-rw-r--r--ext/ffi_yajl/ext/parser/parser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/ffi_yajl/ext/parser/parser.c b/ext/ffi_yajl/ext/parser/parser.c
index e806bd9..837093a 100644
--- a/ext/ffi_yajl/ext/parser/parser.c
+++ b/ext/ffi_yajl/ext/parser/parser.c
@@ -167,14 +167,14 @@ static VALUE mParser_do_yajl_parse(VALUE self, VALUE str, VALUE opts) {
yajl_handle hand;
yajl_status stat;
unsigned char *err;
- CTX ctx;
+ volatile CTX ctx;
rb_ivar_set(self, rb_intern("stack"), rb_ary_new());
rb_ivar_set(self, rb_intern("key_stack"), rb_ary_new());
ctx.self = self;
- hand = yajl_alloc(&callbacks, NULL, &ctx);
+ hand = yajl_alloc(&callbacks, NULL, (void *)&ctx);
if ((stat = yajl_parse(hand, (unsigned char *)RSTRING_PTR(str), RSTRING_LEN(str))) != yajl_status_ok) {
err = yajl_get_error(hand, 1, (unsigned char *)RSTRING_PTR(str), RSTRING_LEN(str));
goto raise;