google-protobuf 3.0.0-x64-mingw32 → 3.0.2-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of google-protobuf might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9516b33cdf5622a5715f807aef0c7b01501aa091
4
- data.tar.gz: 8e545a2677caf483a5e3919caf2eb2856ee39d9c
3
+ metadata.gz: 999a711435fecc3d97a39540027a4524dcdc9782
4
+ data.tar.gz: 497dfce774c88ebc6b8ed3af37f401b49499349e
5
5
  SHA512:
6
- metadata.gz: 5acf86dbadd1b84964ae46bf6af02c658c0e45562fb3ec583291b7bc729d36da9cc9220aa9ddaf27b7465d77ff80f4a8b9c064defd8db39423505b3b03c0bec1
7
- data.tar.gz: f35544f4cf7365c3b0c97baf4768c62769fcd5eeeacb4f70fd6cf0438440266d7fa864d7af89cfed6a2832846cbeaa3aa6aea1e756c699a8b8266147456fa8e4
6
+ metadata.gz: b910e31e98337f12c1ad6f1ca2e45a97b5ec6e1c318eb8a9b0d52dd715f8b98add878dd3b60cddfe55b6cdaef0359e96d85693483e35cb3e09892f915ea16234
7
+ data.tar.gz: 7e50cd0fa70b5b14f246c6b6e0b6fd13273f59671f99ac74b8479ce9424c22f7c2074785737439334a63bbf362a8f06940bb7a19a421672bf3aff97d5b2455fd
@@ -255,10 +255,54 @@ typedef struct {
255
255
  // value into the map.
256
256
  typedef struct {
257
257
  VALUE map;
258
+ const map_handlerdata_t* handlerdata;
258
259
  char key_storage[NATIVE_SLOT_MAX_SIZE];
259
260
  char value_storage[NATIVE_SLOT_MAX_SIZE];
260
261
  } map_parse_frame_t;
261
262
 
263
+ static void MapParseFrame_mark(void* _self) {
264
+ map_parse_frame_t* frame = _self;
265
+
266
+ // This shouldn't strictly be necessary since this should be rooted by the
267
+ // message itself, but it can't hurt.
268
+ rb_gc_mark(frame->map);
269
+
270
+ native_slot_mark(frame->handlerdata->key_field_type, &frame->key_storage);
271
+ native_slot_mark(frame->handlerdata->value_field_type, &frame->value_storage);
272
+ }
273
+
274
+ void MapParseFrame_free(void* self) {
275
+ xfree(self);
276
+ }
277
+
278
+ rb_data_type_t MapParseFrame_type = {
279
+ "MapParseFrame",
280
+ { MapParseFrame_mark, MapParseFrame_free, NULL },
281
+ };
282
+
283
+ // Array of Ruby objects wrapping map_parse_frame_t.
284
+ // We don't allow multiple concurrent decodes, so we assume that this global
285
+ // variable is specific to the "current" decode.
286
+ VALUE map_parse_frames;
287
+
288
+ static map_parse_frame_t* map_push_frame(VALUE map,
289
+ const map_handlerdata_t* handlerdata) {
290
+ map_parse_frame_t* frame = ALLOC(map_parse_frame_t);
291
+ frame->handlerdata = handlerdata;
292
+ frame->map = map;
293
+ native_slot_init(handlerdata->key_field_type, &frame->key_storage);
294
+ native_slot_init(handlerdata->value_field_type, &frame->value_storage);
295
+
296
+ rb_ary_push(map_parse_frames,
297
+ TypedData_Wrap_Struct(rb_cObject, &MapParseFrame_type, frame));
298
+
299
+ return frame;
300
+ }
301
+
302
+ static void map_pop_frame() {
303
+ rb_ary_pop(map_parse_frames);
304
+ }
305
+
262
306
  // Handler to begin a map entry: allocates a temporary frame. This is the
263
307
  // 'startsubmsg' handler on the msgdef that contains the map field.
264
308
  static void *startmapentry_handler(void *closure, const void *hd) {
@@ -266,13 +310,7 @@ static void *startmapentry_handler(void *closure, const void *hd) {
266
310
  const map_handlerdata_t* mapdata = hd;
267
311
  VALUE map_rb = DEREF(msg, mapdata->ofs, VALUE);
268
312
 
269
- map_parse_frame_t* frame = ALLOC(map_parse_frame_t);
270
- frame->map = map_rb;
271
-
272
- native_slot_init(mapdata->key_field_type, &frame->key_storage);
273
- native_slot_init(mapdata->value_field_type, &frame->value_storage);
274
-
275
- return frame;
313
+ return map_push_frame(map_rb, mapdata);
276
314
  }
277
315
 
278
316
  // Handler to end a map entry: inserts the value defined during the message into
@@ -298,7 +336,7 @@ static bool endmap_handler(void *closure, const void *hd, upb_status* s) {
298
336
  &frame->value_storage);
299
337
 
300
338
  Map_index_set(frame->map, key, value);
301
- xfree(frame);
339
+ map_pop_frame();
302
340
 
303
341
  return true;
304
342
  }
@@ -737,6 +775,10 @@ VALUE Message_decode(VALUE klass, VALUE data) {
737
775
  msg_rb = rb_class_new_instance(0, NULL, msgklass);
738
776
  TypedData_Get_Struct(msg_rb, MessageHeader, &Message_type, msg);
739
777
 
778
+ // We generally expect this to be clear already, but clear it in case parsing
779
+ // previously got interrupted somehow.
780
+ rb_ary_clear(map_parse_frames);
781
+
740
782
  {
741
783
  const upb_pbdecodermethod* method = msgdef_decodermethod(desc);
742
784
  const upb_handlers* h = upb_pbdecodermethod_desthandlers(method);
@@ -781,6 +823,10 @@ VALUE Message_decode_json(VALUE klass, VALUE data) {
781
823
  msg_rb = rb_class_new_instance(0, NULL, msgklass);
782
824
  TypedData_Get_Struct(msg_rb, MessageHeader, &Message_type, msg);
783
825
 
826
+ // We generally expect this to be clear already, but clear it in case parsing
827
+ // previously got interrupted somehow.
828
+ rb_ary_clear(map_parse_frames);
829
+
784
830
  {
785
831
  const upb_json_parsermethod* method = msgdef_jsonparsermethod(desc);
786
832
  stackenv se;
@@ -112,4 +112,6 @@ void Init_protobuf_c() {
112
112
 
113
113
  upb_def_to_ruby_obj_map = rb_hash_new();
114
114
  rb_gc_register_address(&upb_def_to_ruby_obj_map);
115
+ map_parse_frames = rb_ary_new();
116
+ rb_gc_register_address(&map_parse_frames);
115
117
  }
@@ -166,6 +166,8 @@ extern VALUE cBuilder;
166
166
  extern VALUE cError;
167
167
  extern VALUE cParseError;
168
168
 
169
+ extern VALUE map_parse_frames;
170
+
169
171
  // We forward-declare all of the Ruby method implementations here because we
170
172
  // sometimes call the methods directly across .c files, rather than going
171
173
  // through Ruby's method dispatching (e.g. during message parse). It's cleaner
@@ -11175,7 +11175,7 @@ static bool parse_mapentry_key(upb_json_parser *p) {
11175
11175
  sel = getsel_for_handlertype(p, UPB_HANDLER_STRING);
11176
11176
  upb_sink_putstring(&subsink, sel, buf, len, NULL);
11177
11177
  sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSTR);
11178
- upb_sink_endstr(&subsink, sel);
11178
+ upb_sink_endstr(&p->top->sink, sel);
11179
11179
  multipart_end(p);
11180
11180
  break;
11181
11181
  }
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.2
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Protobuf Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-29 00:00:00.000000000 Z
11
+ date: 2016-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler-dock