diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-06-13 13:20:39 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-06-13 13:20:39 -0700 |
commit | 844707a0f077589fc9fbb151d1c4f22bef750401 (patch) | |
tree | c383dba41c50c221e813a9b40320e75f47d92732 /ext | |
parent | 7a1f2b7c9de07c25046be344ff438048e707a3e3 (diff) | |
download | ffi-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.c | 4 |
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; |