@@ -266,7 +266,7 @@ typedef enum
266
266
} value_type ;
267
267
268
268
// noexcept
269
- volatile VALUE create_point (scan_ctx * sctx , value_type type , size_t length , size_t curr_pos )
269
+ VALUE create_point (scan_ctx * sctx , value_type type , size_t length , size_t curr_pos )
270
270
{
271
271
VALUE values [3 ];
272
272
volatile VALUE point = rb_ary_new_capa (3 );
@@ -306,7 +306,7 @@ volatile VALUE create_point(scan_ctx *sctx, value_type type, size_t length, size
306
306
}
307
307
308
308
// noexcept
309
- volatile VALUE create_path (scan_ctx * sctx )
309
+ VALUE create_path (scan_ctx * sctx )
310
310
{
311
311
volatile VALUE path = rb_ary_new_capa (sctx -> current_path_len );
312
312
for (int i = 0 ; i < sctx -> current_path_len ; i ++ )
@@ -337,7 +337,7 @@ void save_point(scan_ctx *sctx, value_type type, size_t length)
337
337
// TODO: Abort parsing if all paths are matched and no more mathces are possible: only trivial key/index matchers at the current level
338
338
// TODO: Don't re-compare already matched prefixes; hard to invalidate, though
339
339
// TODO: Might fail in case of no memory
340
- volatile VALUE point = Qundef ;
340
+ volatile VALUE point = Qundef , path ;
341
341
int match ;
342
342
for (int i = 0 ; i < sctx -> paths_len ; i ++ )
343
343
{
@@ -381,7 +381,8 @@ void save_point(scan_ctx *sctx, value_type type, size_t length)
381
381
point = create_point (sctx , type , length , yajl_get_bytes_consumed (sctx -> handle ));
382
382
if (sctx -> with_path )
383
383
{
384
- point = rb_ary_new_from_args (2 , create_path (sctx ), point );
384
+ path = create_path (sctx );
385
+ point = rb_ary_new_from_args (2 , path , point );
385
386
}
386
387
}
387
388
// rb_ary_push raises only in case of a frozen array, which is not the case
0 commit comments