Skip to content

Commit 67a696c

Browse files
committed
merge revision(s) 44809,44811,44813,44815,44816,44817,44818,44918,45003: [Backport ruby#9482]
* ext/psych/yaml/emitter.c: merge libyaml 0.1.5 * ext/psych/yaml/loader.c: ditto * ext/psych/yaml/parser.c: ditto * ext/psych/yaml/reader.c: ditto * ext/psych/yaml/scanner.c: ditto * ext/psych/yaml/writer.c: ditto * ext/psych/yaml/yaml_private.h: ditto * ext/psych/lib/psych.rb: New release of psych. * ext/psych/psych.gemspec: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@45160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent aac2d82 commit 67a696c

File tree

12 files changed

+167
-75
lines changed

12 files changed

+167
-75
lines changed

ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
Mon Feb 24 13:05:48 2014 Aaron Patterson <[email protected]>
2+
3+
* ext/psych/lib/psych.rb: New release of psych.
4+
* ext/psych/psych.gemspec: ditto
5+
6+
Mon Feb 24 13:05:48 2014 Aaron Patterson <[email protected]>
7+
8+
* ext/psych/yaml/emitter.c: merge libyaml 0.1.5
9+
* ext/psych/yaml/loader.c: ditto
10+
* ext/psych/yaml/parser.c: ditto
11+
* ext/psych/yaml/reader.c: ditto
12+
* ext/psych/yaml/scanner.c: ditto
13+
* ext/psych/yaml/writer.c: ditto
14+
* ext/psych/yaml/yaml_private.h: ditto
15+
116
Sat Feb 22 22:26:43 2014 NAKAMURA Usaku <[email protected]>
217

318
* ext/io/console/console.c (console_dev): need read access for conout$

ext/psych/lib/psych.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217

218218
module Psych
219219
# The version is Psych you're using
220-
VERSION = '2.0.2'
220+
VERSION = '2.0.3'
221221

222222
# The version of libyaml Psych is using
223223
LIBYAML_VERSION = Psych.libyaml_version.join '.'

ext/psych/psych.gemspec

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,22 @@
22

33
Gem::Specification.new do |s|
44
s.name = "psych"
5-
s.version = "2.0.2"
5+
s.version = "2.0.3"
66

77
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8+
s.require_paths = ["lib"]
89
s.authors = ["Aaron Patterson"]
9-
s.date = "2013-11-26"
10+
s.date = "2014-02-04"
1011
s.description = "Psych is a YAML parser and emitter. Psych leverages libyaml[http://pyyaml.org/wiki/LibYAML]\nfor its YAML parsing and emitting capabilities. In addition to wrapping\nlibyaml, Psych also knows how to serialize and de-serialize most Ruby objects\nto and from the YAML format."
1112
s.email = ["[email protected]"]
1213
s.extensions = ["ext/psych/extconf.rb"]
13-
s.extra_rdoc_files = ["CHANGELOG.rdoc", "Manifest.txt", "README.rdoc"]
1414
s.files = [".autotest", ".travis.yml", "CHANGELOG.rdoc", "Manifest.txt", "README.rdoc", "Rakefile", "ext/psych/depend", "ext/psych/extconf.rb", "ext/psych/psych.c", "ext/psych/psych.h", "ext/psych/psych_emitter.c", "ext/psych/psych_emitter.h", "ext/psych/psych_parser.c", "ext/psych/psych_parser.h", "ext/psych/psych_to_ruby.c", "ext/psych/psych_to_ruby.h", "ext/psych/psych_yaml_tree.c", "ext/psych/psych_yaml_tree.h", "ext/psych/yaml/LICENSE", "ext/psych/yaml/api.c", "ext/psych/yaml/config.h", "ext/psych/yaml/dumper.c", "ext/psych/yaml/emitter.c", "ext/psych/yaml/loader.c", "ext/psych/yaml/parser.c", "ext/psych/yaml/reader.c", "ext/psych/yaml/scanner.c", "ext/psych/yaml/writer.c", "ext/psych/yaml/yaml.h", "ext/psych/yaml/yaml_private.h", "lib/psych.rb", "lib/psych/class_loader.rb", "lib/psych/coder.rb", "lib/psych/core_ext.rb", "lib/psych/deprecated.rb", "lib/psych/exception.rb", "lib/psych/handler.rb", "lib/psych/handlers/document_stream.rb", "lib/psych/handlers/recorder.rb", "lib/psych/json/ruby_events.rb", "lib/psych/json/stream.rb", "lib/psych/json/tree_builder.rb", "lib/psych/json/yaml_events.rb", "lib/psych/nodes.rb", "lib/psych/nodes/alias.rb", "lib/psych/nodes/document.rb", "lib/psych/nodes/mapping.rb", "lib/psych/nodes/node.rb", "lib/psych/nodes/scalar.rb", "lib/psych/nodes/sequence.rb", "lib/psych/nodes/stream.rb", "lib/psych/omap.rb", "lib/psych/parser.rb", "lib/psych/scalar_scanner.rb", "lib/psych/set.rb", "lib/psych/stream.rb", "lib/psych/streaming.rb", "lib/psych/syntax_error.rb", "lib/psych/tree_builder.rb", "lib/psych/visitors.rb", "lib/psych/visitors/depth_first.rb", "lib/psych/visitors/emitter.rb", "lib/psych/visitors/json_tree.rb", "lib/psych/visitors/to_ruby.rb", "lib/psych/visitors/visitor.rb", "lib/psych/visitors/yaml_tree.rb", "lib/psych/y.rb", "test/psych/handlers/test_recorder.rb", "test/psych/helper.rb", "test/psych/json/test_stream.rb", "test/psych/nodes/test_enumerable.rb", "test/psych/test_alias_and_anchor.rb", "test/psych/test_array.rb", "test/psych/test_boolean.rb", "test/psych/test_class.rb", "test/psych/test_coder.rb", "test/psych/test_date_time.rb", "test/psych/test_deprecated.rb", "test/psych/test_document.rb", "test/psych/test_emitter.rb", "test/psych/test_encoding.rb", "test/psych/test_engine_manager.rb", "test/psych/test_exception.rb", "test/psych/test_hash.rb", "test/psych/test_json_tree.rb", "test/psych/test_merge_keys.rb", "test/psych/test_nil.rb", "test/psych/test_null.rb", "test/psych/test_numeric.rb", "test/psych/test_object.rb", "test/psych/test_object_references.rb", "test/psych/test_omap.rb", "test/psych/test_parser.rb", "test/psych/test_psych.rb", "test/psych/test_safe_load.rb", "test/psych/test_scalar.rb", "test/psych/test_scalar_scanner.rb", "test/psych/test_serialize_subclasses.rb", "test/psych/test_set.rb", "test/psych/test_stream.rb", "test/psych/test_string.rb", "test/psych/test_struct.rb", "test/psych/test_symbol.rb", "test/psych/test_tainted.rb", "test/psych/test_to_yaml_properties.rb", "test/psych/test_tree_builder.rb", "test/psych/test_yaml.rb", "test/psych/test_yamldbm.rb", "test/psych/test_yamlstore.rb", "test/psych/visitors/test_depth_first.rb", "test/psych/visitors/test_emitter.rb", "test/psych/visitors/test_to_ruby.rb", "test/psych/visitors/test_yaml_tree.rb", ".gemtest"]
1515
s.homepage = "http://github.com/tenderlove/psych"
1616
s.licenses = ["MIT"]
1717
s.rdoc_options = ["--main", "README.rdoc"]
18-
s.require_paths = ["lib"]
1918
s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
2019
s.rubyforge_project = "psych"
21-
s.rubygems_version = "2.0.2"
20+
s.rubygems_version = "2.2.1"
2221
s.summary = "Psych is a YAML parser and emitter"
2322
s.test_files = ["test/psych/handlers/test_recorder.rb", "test/psych/json/test_stream.rb", "test/psych/nodes/test_enumerable.rb", "test/psych/test_alias_and_anchor.rb", "test/psych/test_array.rb", "test/psych/test_boolean.rb", "test/psych/test_class.rb", "test/psych/test_coder.rb", "test/psych/test_date_time.rb", "test/psych/test_deprecated.rb", "test/psych/test_document.rb", "test/psych/test_emitter.rb", "test/psych/test_encoding.rb", "test/psych/test_engine_manager.rb", "test/psych/test_exception.rb", "test/psych/test_hash.rb", "test/psych/test_json_tree.rb", "test/psych/test_merge_keys.rb", "test/psych/test_nil.rb", "test/psych/test_null.rb", "test/psych/test_numeric.rb", "test/psych/test_object.rb", "test/psych/test_object_references.rb", "test/psych/test_omap.rb", "test/psych/test_parser.rb", "test/psych/test_psych.rb", "test/psych/test_safe_load.rb", "test/psych/test_scalar.rb", "test/psych/test_scalar_scanner.rb", "test/psych/test_serialize_subclasses.rb", "test/psych/test_set.rb", "test/psych/test_stream.rb", "test/psych/test_string.rb", "test/psych/test_struct.rb", "test/psych/test_symbol.rb", "test/psych/test_tainted.rb", "test/psych/test_to_yaml_properties.rb", "test/psych/test_tree_builder.rb", "test/psych/test_yaml.rb", "test/psych/test_yamldbm.rb", "test/psych/test_yamlstore.rb", "test/psych/visitors/test_depth_first.rb", "test/psych/visitors/test_emitter.rb", "test/psych/visitors/test_to_ruby.rb", "test/psych/visitors/test_yaml_tree.rb"]
2423
end

ext/psych/yaml/api.c

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ yaml_emitter_delete(yaml_emitter_t *emitter)
395395
}
396396
QUEUE_DEL(emitter, emitter->events);
397397
STACK_DEL(emitter, emitter->indents);
398-
while (!STACK_EMPTY(empty, emitter->tag_directives)) {
398+
while (!STACK_EMPTY(emitter, emitter->tag_directives)) {
399399
yaml_tag_directive_t tag_directive = POP(emitter, emitter->tag_directives);
400400
yaml_free(tag_directive.handle);
401401
yaml_free(tag_directive.prefix);
@@ -822,6 +822,7 @@ yaml_scalar_event_initialize(yaml_event_t *event,
822822
yaml_char_t *anchor_copy = NULL;
823823
yaml_char_t *tag_copy = NULL;
824824
yaml_char_t *value_copy = NULL;
825+
size_t value_length;
825826

826827
assert(event); /* Non-NULL event object is expected. */
827828
assert(value); /* Non-NULL anchor is expected. */
@@ -839,16 +840,19 @@ yaml_scalar_event_initialize(yaml_event_t *event,
839840
}
840841

841842
if (length < 0) {
842-
length = strlen((char *)value);
843+
value_length = strlen((char *)value);
844+
}
845+
else {
846+
value_length = (size_t)length;
843847
}
844848

845-
if (!yaml_check_utf8(value, length)) goto error;
846-
value_copy = yaml_malloc(length+1);
849+
if (!yaml_check_utf8(value, value_length)) goto error;
850+
value_copy = yaml_malloc(value_length+1);
847851
if (!value_copy) goto error;
848-
memcpy(value_copy, value, length);
849-
value_copy[length] = '\0';
852+
memcpy(value_copy, value, value_length);
853+
value_copy[value_length] = '\0';
850854

851-
SCALAR_EVENT_INIT(*event, anchor_copy, tag_copy, value_copy, length,
855+
SCALAR_EVENT_INIT(*event, anchor_copy, tag_copy, value_copy, value_length,
852856
plain_implicit, quoted_implicit, style, mark, mark);
853857

854858
return 1;
@@ -1202,6 +1206,8 @@ yaml_document_add_scalar(yaml_document_t *document,
12021206
yaml_char_t *tag_copy = NULL;
12031207
yaml_char_t *value_copy = NULL;
12041208
yaml_node_t node;
1209+
size_t value_length;
1210+
ptrdiff_t ret;
12051211

12061212
assert(document); /* Non-NULL document object is expected. */
12071213
assert(value); /* Non-NULL value is expected. */
@@ -1215,19 +1221,26 @@ yaml_document_add_scalar(yaml_document_t *document,
12151221
if (!tag_copy) goto error;
12161222

12171223
if (length < 0) {
1218-
length = strlen((char *)value);
1224+
value_length = strlen((char *)value);
1225+
}
1226+
else {
1227+
value_length = (size_t)length;
12191228
}
12201229

1221-
if (!yaml_check_utf8(value, length)) goto error;
1222-
value_copy = yaml_malloc(length+1);
1230+
if (!yaml_check_utf8(value, value_length)) goto error;
1231+
value_copy = yaml_malloc(value_length+1);
12231232
if (!value_copy) goto error;
1224-
memcpy(value_copy, value, length);
1225-
value_copy[length] = '\0';
1233+
memcpy(value_copy, value, value_length);
1234+
value_copy[value_length] = '\0';
12261235

1227-
SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark);
1236+
SCALAR_NODE_INIT(node, tag_copy, value_copy, value_length, style, mark, mark);
12281237
if (!PUSH(&context, document->nodes, node)) goto error;
12291238

1230-
return document->nodes.top - document->nodes.start;
1239+
ret = document->nodes.top - document->nodes.start;
1240+
#if PTRDIFF_MAX > INT_MAX
1241+
if (ret > INT_MAX) goto error;
1242+
#endif
1243+
return (int)ret;
12311244

12321245
error:
12331246
yaml_free(tag_copy);
@@ -1255,6 +1268,7 @@ yaml_document_add_sequence(yaml_document_t *document,
12551268
yaml_node_item_t *top;
12561269
} items = { NULL, NULL, NULL };
12571270
yaml_node_t node;
1271+
ptrdiff_t ret;
12581272

12591273
assert(document); /* Non-NULL document object is expected. */
12601274

@@ -1272,7 +1286,11 @@ yaml_document_add_sequence(yaml_document_t *document,
12721286
style, mark, mark);
12731287
if (!PUSH(&context, document->nodes, node)) goto error;
12741288

1275-
return document->nodes.top - document->nodes.start;
1289+
ret = document->nodes.top - document->nodes.start;
1290+
#if PTRDIFF_MAX > INT_MAX
1291+
if (ret > INT_MAX) goto error;
1292+
#endif
1293+
return (int)ret;
12761294

12771295
error:
12781296
STACK_DEL(&context, items);
@@ -1300,6 +1318,7 @@ yaml_document_add_mapping(yaml_document_t *document,
13001318
yaml_node_pair_t *top;
13011319
} pairs = { NULL, NULL, NULL };
13021320
yaml_node_t node;
1321+
ptrdiff_t ret;
13031322

13041323
assert(document); /* Non-NULL document object is expected. */
13051324

@@ -1317,7 +1336,11 @@ yaml_document_add_mapping(yaml_document_t *document,
13171336
style, mark, mark);
13181337
if (!PUSH(&context, document->nodes, node)) goto error;
13191338

1320-
return document->nodes.top - document->nodes.start;
1339+
ret = document->nodes.top - document->nodes.start;
1340+
#if PTRDIFF_MAX > INT_MAX
1341+
if (ret > INT_MAX) goto error;
1342+
#endif
1343+
return (int)ret;
13211344

13221345
error:
13231346
STACK_DEL(&context, pairs);

ext/psych/yaml/config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
#define PACKAGE_NAME "yaml"
33
#define PACKAGE_TARNAME "yaml"
4-
#define PACKAGE_VERSION "0.1.4"
5-
#define PACKAGE_STRING "yaml 0.1.4"
4+
#define PACKAGE_VERSION "0.1.5"
5+
#define PACKAGE_STRING "yaml 0.1.5"
66
#define PACKAGE_BUGREPORT "http://pyyaml.org/newticket?component libyaml"
77
#define PACKAGE_URL ""
88
#define YAML_VERSION_MAJOR 0
99
#define YAML_VERSION_MINOR 1
10-
#define YAML_VERSION_PATCH 4
11-
#define YAML_VERSION_STRING "0.1.4"
10+
#define YAML_VERSION_PATCH 5
11+
#define YAML_VERSION_STRING "0.1.5"

ext/psych/yaml/emitter.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
#define WRITE_BREAK(emitter,string) \
5454
(FLUSH(emitter) \
5555
&& (CHECK(string,'\n') ? \
56-
(PUT_BREAK(emitter), \
56+
((void)PUT_BREAK(emitter), \
5757
string.pointer ++, \
5858
1) : \
5959
(COPY(emitter->buffer,string), \
@@ -1493,7 +1493,7 @@ yaml_emitter_analyze_scalar(yaml_emitter_t *emitter,
14931493
int break_space = 0;
14941494
int space_break = 0;
14951495

1496-
int preceded_by_whitespace = 0;
1496+
int preceeded_by_whitespace = 0;
14971497
int followed_by_whitespace = 0;
14981498
int previous_space = 0;
14991499
int previous_break = 0;
@@ -1524,7 +1524,7 @@ yaml_emitter_analyze_scalar(yaml_emitter_t *emitter,
15241524
flow_indicators = 1;
15251525
}
15261526

1527-
preceded_by_whitespace = 1;
1527+
preceeded_by_whitespace = 1;
15281528
followed_by_whitespace = IS_BLANKZ_AT(string, WIDTH(string));
15291529

15301530
while (string.pointer != string.end)
@@ -1570,7 +1570,7 @@ yaml_emitter_analyze_scalar(yaml_emitter_t *emitter,
15701570
}
15711571
}
15721572

1573-
if (CHECK(string, '#') && preceded_by_whitespace) {
1573+
if (CHECK(string, '#') && preceeded_by_whitespace) {
15741574
flow_indicators = 1;
15751575
block_indicators = 1;
15761576
}
@@ -1619,7 +1619,7 @@ yaml_emitter_analyze_scalar(yaml_emitter_t *emitter,
16191619
previous_break = 0;
16201620
}
16211621

1622-
preceded_by_whitespace = IS_BLANKZ(string);
1622+
preceeded_by_whitespace = IS_BLANKZ(string);
16231623
MOVE(string);
16241624
if (string.pointer != string.end) {
16251625
followed_by_whitespace = IS_BLANKZ_AT(string, WIDTH(string));

ext/psych/yaml/loader.c

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,12 @@ static int
283283
yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event)
284284
{
285285
yaml_node_t node;
286+
ptrdiff_t node_index;
286287
int index;
287288
yaml_char_t *tag = first_event->data.scalar.tag;
288289

290+
if (!STACK_LIMIT(parser, parser->document->nodes, INT_MAX-1)) goto error;
291+
289292
if (!tag || strcmp((char *)tag, "!") == 0) {
290293
yaml_free(tag);
291294
tag = yaml_strdup((yaml_char_t *)YAML_DEFAULT_SCALAR_TAG);
@@ -298,7 +301,11 @@ yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event)
298301

299302
if (!PUSH(parser, parser->document->nodes, node)) goto error;
300303

301-
index = parser->document->nodes.top - parser->document->nodes.start;
304+
node_index = parser->document->nodes.top - parser->document->nodes.start;
305+
#if PTRDIFF_MAX > INT_MAX
306+
if (node_index > INT_MAX) goto error;
307+
#endif
308+
index = (int)node_index;
302309

303310
if (!yaml_parser_register_anchor(parser, index,
304311
first_event->data.scalar.anchor)) return 0;
@@ -327,8 +334,11 @@ yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
327334
yaml_node_item_t *top;
328335
} items = { NULL, NULL, NULL };
329336
int index, item_index;
337+
ptrdiff_t node_index;
330338
yaml_char_t *tag = first_event->data.sequence_start.tag;
331339

340+
if (!STACK_LIMIT(parser, parser->document->nodes, INT_MAX-1)) goto error;
341+
332342
if (!tag || strcmp((char *)tag, "!") == 0) {
333343
yaml_free(tag);
334344
tag = yaml_strdup((yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG);
@@ -343,14 +353,21 @@ yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
343353

344354
if (!PUSH(parser, parser->document->nodes, node)) goto error;
345355

346-
index = parser->document->nodes.top - parser->document->nodes.start;
356+
node_index = parser->document->nodes.top - parser->document->nodes.start;
357+
#if PTRDIFF_MAX > INT_MAX
358+
if (node_index > INT_MAX) goto error;
359+
#endif
360+
index = (int)node_index;
347361

348362
if (!yaml_parser_register_anchor(parser, index,
349363
first_event->data.sequence_start.anchor)) return 0;
350364

351365
if (!yaml_parser_parse(parser, &event)) return 0;
352366

353367
while (event.type != YAML_SEQUENCE_END_EVENT) {
368+
if (!STACK_LIMIT(parser,
369+
parser->document->nodes.start[index-1].data.sequence.items,
370+
INT_MAX-1)) return 0;
354371
item_index = yaml_parser_load_node(parser, &event);
355372
if (!item_index) return 0;
356373
if (!PUSH(parser,
@@ -384,9 +401,12 @@ yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
384401
yaml_node_pair_t *top;
385402
} pairs = { NULL, NULL, NULL };
386403
int index;
404+
ptrdiff_t node_index;
387405
yaml_node_pair_t pair;
388406
yaml_char_t *tag = first_event->data.mapping_start.tag;
389407

408+
if (!STACK_LIMIT(parser, parser->document->nodes, INT_MAX-1)) goto error;
409+
390410
if (!tag || strcmp((char *)tag, "!") == 0) {
391411
yaml_free(tag);
392412
tag = yaml_strdup((yaml_char_t *)YAML_DEFAULT_MAPPING_TAG);
@@ -401,14 +421,21 @@ yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
401421

402422
if (!PUSH(parser, parser->document->nodes, node)) goto error;
403423

404-
index = parser->document->nodes.top - parser->document->nodes.start;
424+
node_index = parser->document->nodes.top - parser->document->nodes.start;
425+
#if PTRDIFF_MAX > INT_MAX
426+
if (node_index > INT_MAX) goto error;
427+
#endif
428+
index = (int)node_index;
405429

406430
if (!yaml_parser_register_anchor(parser, index,
407431
first_event->data.mapping_start.anchor)) return 0;
408432

409433
if (!yaml_parser_parse(parser, &event)) return 0;
410434

411435
while (event.type != YAML_MAPPING_END_EVENT) {
436+
if (!STACK_LIMIT(parser,
437+
parser->document->nodes.start[index-1].data.mapping.pairs,
438+
INT_MAX-1)) return 0;
412439
pair.key = yaml_parser_load_node(parser, &event);
413440
if (!pair.key) return 0;
414441
if (!yaml_parser_parse(parser, &event)) return 0;

ext/psych/yaml/parser.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -759,9 +759,8 @@ yaml_parser_parse_block_sequence_entry(yaml_parser_t *parser,
759759

760760
else if (token->type == YAML_BLOCK_END_TOKEN)
761761
{
762-
yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
763762
parser->state = POP(parser, parser->states);
764-
dummy_mark = POP(parser, parser->marks);
763+
(void)POP(parser, parser->marks);
765764
SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
766765
SKIP_TOKEN(parser);
767766
return 1;
@@ -869,9 +868,8 @@ yaml_parser_parse_block_mapping_key(yaml_parser_t *parser,
869868

870869
else if (token->type == YAML_BLOCK_END_TOKEN)
871870
{
872-
yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
873871
parser->state = POP(parser, parser->states);
874-
dummy_mark = POP(parser, parser->marks);
872+
(void)POP(parser, parser->marks);
875873
MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
876874
SKIP_TOKEN(parser);
877875
return 1;
@@ -952,7 +950,6 @@ yaml_parser_parse_flow_sequence_entry(yaml_parser_t *parser,
952950
yaml_event_t *event, int first)
953951
{
954952
yaml_token_t *token;
955-
yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
956953

957954
if (first) {
958955
token = PEEK_TOKEN(parser);
@@ -997,7 +994,7 @@ yaml_parser_parse_flow_sequence_entry(yaml_parser_t *parser,
997994
}
998995

999996
parser->state = POP(parser, parser->states);
1000-
dummy_mark = POP(parser, parser->marks);
997+
(void)POP(parser, parser->marks);
1001998
SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
1002999
SKIP_TOKEN(parser);
10031000
return 1;
@@ -1104,7 +1101,6 @@ yaml_parser_parse_flow_mapping_key(yaml_parser_t *parser,
11041101
yaml_event_t *event, int first)
11051102
{
11061103
yaml_token_t *token;
1107-
yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
11081104

11091105
if (first) {
11101106
token = PEEK_TOKEN(parser);
@@ -1158,7 +1154,7 @@ yaml_parser_parse_flow_mapping_key(yaml_parser_t *parser,
11581154
}
11591155

11601156
parser->state = POP(parser, parser->states);
1161-
dummy_mark = POP(parser, parser->marks);
1157+
(void)POP(parser, parser->marks);
11621158
MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
11631159
SKIP_TOKEN(parser);
11641160
return 1;

0 commit comments

Comments
 (0)