ruby-changes:47127
From: usa <ko1@a...>
Date: Sat, 1 Jul 2017 00:30:11 +0900 (JST)
Subject: [ruby-changes:47127] usa:r59242 (ruby_2_3): * ext/psych/yaml: update libyaml to 0.1.7.
usa 2017-07-01 00:30:03 +0900 (Sat, 01 Jul 2017) New Revision: 59242 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59242 Log: * ext/psych/yaml: update libyaml to 0.1.7. * ext/psych/psych.gemspec: bump version to 2.1.0.1. Modified files: branches/ruby_2_3/ChangeLog branches/ruby_2_3/ext/psych/psych.gemspec branches/ruby_2_3/ext/psych/yaml/api.c branches/ruby_2_3/ext/psych/yaml/config.h branches/ruby_2_3/ext/psych/yaml/emitter.c branches/ruby_2_3/ext/psych/yaml/loader.c branches/ruby_2_3/ext/psych/yaml/parser.c branches/ruby_2_3/ext/psych/yaml/scanner.c branches/ruby_2_3/ext/psych/yaml/yaml_private.h branches/ruby_2_3/version.h Index: ruby_2_3/version.h =================================================================== --- ruby_2_3/version.h (revision 59241) +++ ruby_2_3/version.h (revision 59242) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1 #define RUBY_VERSION "2.3.5" -#define RUBY_RELEASE_DATE "2017-06-30" -#define RUBY_PATCHLEVEL 338 +#define RUBY_RELEASE_DATE "2017-07-01" +#define RUBY_PATCHLEVEL 339 #define RUBY_RELEASE_YEAR 2017 -#define RUBY_RELEASE_MONTH 6 -#define RUBY_RELEASE_DAY 30 +#define RUBY_RELEASE_MONTH 7 +#define RUBY_RELEASE_DAY 1 #include "ruby/version.h" Index: ruby_2_3/ChangeLog =================================================================== --- ruby_2_3/ChangeLog (revision 59241) +++ ruby_2_3/ChangeLog (revision 59242) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1 +Sat Jul 1 00:28:22 2017 SHIBATA Hiroshi <hsbt@r...> + + * ext/psych/yaml: update libyaml to 0.1.7. + + * ext/psych/psych.gemspec: bump version to 2.1.0.1. + Fri Jun 30 22:05:39 2017 Nobuyoshi Nakada <nobu@r...> * parse.y (parser_precise_mbclen): check invalid multibyte char at Index: ruby_2_3/ext/psych/yaml/yaml_private.h =================================================================== --- ruby_2_3/ext/psych/yaml/yaml_private.h (revision 59241) +++ ruby_2_3/ext/psych/yaml/yaml_private.h (revision 59242) @@ -436,8 +436,7 @@ yaml_queue_extend(void **start, void **h https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/yaml_private.h#L436 (stack).start = (stack).top = (stack).end = 0) #define STACK_EMPTY(context,stack) \ - ((void)(context), \ - ((stack).start == (stack).top)) + ((stack).start == (stack).top) #define STACK_LIMIT(context,stack,size) \ ((stack).top - (stack).start < (size) ? \ @@ -661,4 +660,3 @@ yaml_queue_extend(void **start, void **h https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/yaml_private.h#L660 (node).data.mapping.pairs.end = (node_pairs_end), \ (node).data.mapping.pairs.top = (node_pairs_start), \ (node).data.mapping.style = (node_style)) - Index: ruby_2_3/ext/psych/yaml/loader.c =================================================================== --- ruby_2_3/ext/psych/yaml/loader.c (revision 59241) +++ ruby_2_3/ext/psych/yaml/loader.c (revision 59242) @@ -283,7 +283,6 @@ static int https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/loader.c#L283 yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event) { yaml_node_t node; - ptrdiff_t node_index; int index; yaml_char_t *tag = first_event->data.scalar.tag; @@ -301,11 +300,7 @@ yaml_parser_load_scalar(yaml_parser_t *p https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/loader.c#L300 if (!PUSH(parser, parser->document->nodes, node)) goto error; - node_index = parser->document->nodes.top - parser->document->nodes.start; -#if PTRDIFF_MAX > INT_MAX - if (node_index > INT_MAX) goto error; -#endif - index = (int)node_index; + index = parser->document->nodes.top - parser->document->nodes.start; if (!yaml_parser_register_anchor(parser, index, first_event->data.scalar.anchor)) return 0; @@ -334,7 +329,6 @@ yaml_parser_load_sequence(yaml_parser_t https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/loader.c#L329 yaml_node_item_t *top; } items = { NULL, NULL, NULL }; int index, item_index; - ptrdiff_t node_index; yaml_char_t *tag = first_event->data.sequence_start.tag; if (!STACK_LIMIT(parser, parser->document->nodes, INT_MAX-1)) goto error; @@ -353,11 +347,7 @@ yaml_parser_load_sequence(yaml_parser_t https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/loader.c#L347 if (!PUSH(parser, parser->document->nodes, node)) goto error; - node_index = parser->document->nodes.top - parser->document->nodes.start; -#if PTRDIFF_MAX > INT_MAX - if (node_index > INT_MAX) goto error; -#endif - index = (int)node_index; + index = parser->document->nodes.top - parser->document->nodes.start; if (!yaml_parser_register_anchor(parser, index, first_event->data.sequence_start.anchor)) return 0; @@ -401,7 +391,6 @@ yaml_parser_load_mapping(yaml_parser_t * https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/loader.c#L391 yaml_node_pair_t *top; } pairs = { NULL, NULL, NULL }; int index; - ptrdiff_t node_index; yaml_node_pair_t pair; yaml_char_t *tag = first_event->data.mapping_start.tag; @@ -421,11 +410,7 @@ yaml_parser_load_mapping(yaml_parser_t * https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/loader.c#L410 if (!PUSH(parser, parser->document->nodes, node)) goto error; - node_index = parser->document->nodes.top - parser->document->nodes.start; -#if PTRDIFF_MAX > INT_MAX - if (node_index > INT_MAX) goto error; -#endif - index = (int)node_index; + index = parser->document->nodes.top - parser->document->nodes.start; if (!yaml_parser_register_anchor(parser, index, first_event->data.mapping_start.anchor)) return 0; Index: ruby_2_3/ext/psych/yaml/api.c =================================================================== --- ruby_2_3/ext/psych/yaml/api.c (revision 59241) +++ ruby_2_3/ext/psych/yaml/api.c (revision 59242) @@ -395,7 +395,7 @@ yaml_emitter_delete(yaml_emitter_t *emit https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/api.c#L395 } QUEUE_DEL(emitter, emitter->events); STACK_DEL(emitter, emitter->indents); - while (!STACK_EMPTY(emitter, emitter->tag_directives)) { + while (!STACK_EMPTY(empty, emitter->tag_directives)) { yaml_tag_directive_t tag_directive = POP(emitter, emitter->tag_directives); yaml_free(tag_directive.handle); yaml_free(tag_directive.prefix); @@ -415,7 +415,7 @@ yaml_string_write_handler(void *data, un https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/api.c#L415 { yaml_emitter_t *emitter = data; - if (emitter->output.string.size + *emitter->output.string.size_written + if (emitter->output.string.size - *emitter->output.string.size_written < size) { memcpy(emitter->output.string.buffer + *emitter->output.string.size_written, @@ -822,7 +822,6 @@ yaml_scalar_event_initialize(yaml_event_ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/api.c#L822 yaml_char_t *anchor_copy = NULL; yaml_char_t *tag_copy = NULL; yaml_char_t *value_copy = NULL; - size_t value_length; assert(event); /* Non-NULL event object is expected. */ assert(value); /* Non-NULL anchor is expected. */ @@ -840,19 +839,16 @@ yaml_scalar_event_initialize(yaml_event_ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/api.c#L839 } if (length < 0) { - value_length = strlen((char *)value); - } - else { - value_length = (size_t)length; + length = strlen((char *)value); } - if (!yaml_check_utf8(value, value_length)) goto error; - value_copy = yaml_malloc(value_length+1); + if (!yaml_check_utf8(value, length)) goto error; + value_copy = yaml_malloc(length+1); if (!value_copy) goto error; - memcpy(value_copy, value, value_length); - value_copy[value_length] = '\0'; + memcpy(value_copy, value, length); + value_copy[length] = '\0'; - SCALAR_EVENT_INIT(*event, anchor_copy, tag_copy, value_copy, value_length, + SCALAR_EVENT_INIT(*event, anchor_copy, tag_copy, value_copy, length, plain_implicit, quoted_implicit, style, mark, mark); return 1; @@ -1206,8 +1202,6 @@ yaml_document_add_scalar(yaml_document_t https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/api.c#L1202 yaml_char_t *tag_copy = NULL; yaml_char_t *value_copy = NULL; yaml_node_t node; - size_t value_length; - ptrdiff_t ret; assert(document); /* Non-NULL document object is expected. */ assert(value); /* Non-NULL value is expected. */ @@ -1221,26 +1215,19 @@ yaml_document_add_scalar(yaml_document_t https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/api.c#L1215 if (!tag_copy) goto error; if (length < 0) { - value_length = strlen((char *)value); - } - else { - value_length = (size_t)length; + length = strlen((char *)value); } - if (!yaml_check_utf8(value, value_length)) goto error; - value_copy = yaml_malloc(value_length+1); + if (!yaml_check_utf8(value, length)) goto error; + value_copy = yaml_malloc(length+1); if (!value_copy) goto error; - memcpy(value_copy, value, value_length); - value_copy[value_length] = '\0'; + memcpy(value_copy, value, length); + value_copy[length] = '\0'; - SCALAR_NODE_INIT(node, tag_copy, value_copy, value_length, style, mark, mark); + SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark); if (!PUSH(&context, document->nodes, node)) goto error; - ret = document->nodes.top - document->nodes.start; -#if PTRDIFF_MAX > INT_MAX - if (ret > INT_MAX) goto error; -#endif - return (int)ret; + return document->nodes.top - document->nodes.start; error: yaml_free(tag_copy); @@ -1268,7 +1255,6 @@ yaml_document_add_sequence(yaml_document https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/api.c#L1255 yaml_node_item_t *top; } items = { NULL, NULL, NULL }; yaml_node_t node; - ptrdiff_t ret; assert(document); /* Non-NULL document object is expected. */ @@ -1286,11 +1272,7 @@ yaml_document_add_sequence(yaml_document https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/api.c#L1272 style, mark, mark); if (!PUSH(&context, document->nodes, node)) goto error; - ret = document->nodes.top - document->nodes.start; -#if PTRDIFF_MAX > INT_MAX - if (ret > INT_MAX) goto error; -#endif - return (int)ret; + return document->nodes.top - document->nodes.start; error: STACK_DEL(&context, items); @@ -1318,7 +1300,6 @@ yaml_document_add_mapping(yaml_document_ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/api.c#L1300 yaml_node_pair_t *top; } pairs = { NULL, NULL, NULL }; yaml_node_t node; - ptrdiff_t ret; assert(document); /* Non-NULL document object is expected. */ @@ -1336,11 +1317,7 @@ yaml_document_add_mapping(yaml_document_ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/api.c#L1317 style, mark, mark); if (!PUSH(&context, document->nodes, node)) goto error; - ret = document->nodes.top - document->nodes.start; -#if PTRDIFF_MAX > INT_MAX - if (ret > INT_MAX) goto error; -#endif - return (int)ret; + return document->nodes.top - document->nodes.start; error: STACK_DEL(&context, pairs); Index: ruby_2_3/ext/psych/yaml/emitter.c =================================================================== --- ruby_2_3/ext/psych/yaml/emitter.c (revision 59241) +++ ruby_2_3/ext/psych/yaml/emitter.c (revision 59242) @@ -53,7 +53,7 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/emitter.c#L53 #define WRITE_BREAK(emitter,string) \ (FLUSH(emitter) \ && (CHECK(string,'\n') ? \ - ((void)PUT_BREAK(emitter), \ + (PUT_BREAK(emitter), \ string.pointer ++, \ 1) : \ (COPY(emitter->buffer,string), \ @@ -221,7 +221,7 @@ yaml_emitter_write_indent(yaml_emitter_t https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/emitter.c#L221 static int yaml_emitter_write_indicator(yaml_emitter_t *emitter, - const char *indicator, int need_whitespace, + char *indicator, int need_whitespace, int is_whitespace, int is_indention); static int @@ -1493,7 +1493,7 @@ yaml_emitter_analyze_scalar(yaml_emitter https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/emitter.c#L1493 int break_space = 0; int space_break = 0; - int preceeded_by_whitespace = 0; + int preceded_by_whitespace = 0; int followed_by_whitespace = 0; int previous_space = 0; int previous_break = 0; @@ -1524,7 +1524,7 @@ yaml_emitter_analyze_scalar(yaml_emitter https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/emitter.c#L1524 flow_indicators = 1; } - preceeded_by_whitespace = 1; + preceded_by_whitespace = 1; followed_by_whitespace = IS_BLANKZ_AT(string, WIDTH(string)); while (string.pointer != string.end) @@ -1570,7 +1570,7 @@ yaml_emitter_analyze_scalar(yaml_emitter https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/emitter.c#L1570 } } - if (CHECK(string, '#') && preceeded_by_whitespace) { + if (CHECK(string, '#') && preceded_by_whitespace) { flow_indicators = 1; block_indicators = 1; } @@ -1619,7 +1619,7 @@ yaml_emitter_analyze_scalar(yaml_emitter https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/emitter.c#L1619 previous_break = 0; } - preceeded_by_whitespace = IS_BLANKZ(string); + preceded_by_whitespace = IS_BLANKZ(string); MOVE(string); if (string.pointer != string.end) { followed_by_whitespace = IS_BLANKZ_AT(string, WIDTH(string)); @@ -1784,7 +1784,7 @@ yaml_emitter_write_indent(yaml_emitter_t https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/emitter.c#L1784 static int yaml_emitter_write_indicator(yaml_emitter_t *emitter, - const char *indicator, int need_whitespace, + char *indicator, int need_whitespace, int is_whitespace, int is_indention) { size_t indicator_length; @@ -2178,7 +2178,7 @@ yaml_emitter_write_block_scalar_hints(ya https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/emitter.c#L2178 yaml_string_t string) { char indent_hint[2]; - const char *chomp_hint = NULL; + char *chomp_hint = NULL; if (IS_SPACE(string) || IS_BREAK(string)) { Index: ruby_2_3/ext/psych/yaml/scanner.c =================================================================== --- ruby_2_3/ext/psych/yaml/scanner.c (revision 59241) +++ ruby_2_3/ext/psych/yaml/scanner.c (revision 59242) @@ -1186,9 +1186,11 @@ yaml_parser_increase_flow_level(yaml_par https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/scanner.c#L1186 static int yaml_parser_decrease_flow_level(yaml_parser_t *parser) { + yaml_simple_key_t dummy_key; /* Used to eliminate a compiler warning. */ + if (parser->flow_level) { parser->flow_level --; - (void)POP(parser, parser->simple_keys); + dummy_key = POP(parser, parser->simple_keys); } return 1; @@ -1222,14 +1224,12 @@ yaml_parser_roll_indent(yaml_parser_t *p https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/scanner.c#L1224 if (!PUSH(parser, parser->indents, parser->indent)) return 0; -#if PTRDIFF_MAX > INT_MAX if (column > INT_MAX) { parser->error = YAML_MEMORY_ERROR; return 0; } -#endif - parser->indent = (int)column; + parser->indent = column; /* Create a token and insert it into the queue. */ @@ -3504,12 +3504,12 @@ yaml_parser_scan_plain_scalar(yaml_parse https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/scanner.c#L3504 { if (IS_BLANK(parser->buffer)) { - /* Check for tab character that abuse indentation. */ + /* Check for tab characters that abuse indentation. */ if (leading_blanks && (int)parser->mark.column < indent && IS_TAB(parser->buffer)) { yaml_parser_set_scanner_error(parser, "while scanning a plain scalar", - start_mark, "found a tab character that violate indentation"); + start_mark, "found a tab character that violates indentation"); goto error; } Index: ruby_2_3/ext/psych/yaml/config.h =================================================================== --- ruby_2_3/ext/psych/yaml/config.h (revision 59241) +++ ruby_2_3/ext/psych/yaml/config.h (revision 59242) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/config.h#L1 #define PACKAGE_NAME "yaml" #define PACKAGE_TARNAME "yaml" -#define PACKAGE_VERSION "0.1.6" -#define PACKAGE_STRING "yaml 0.1.6" -#define PACKAGE_BUGREPORT "http://pyyaml.org/newticket?component libyaml" -#define PACKAGE_URL "" +#define PACKAGE_VERSION "0.1.7" +#define PACKAGE_STRING "yaml 0.1.7" +#define PACKAGE_BUGREPORT "https://github.com/yaml/libyaml/issues" +#define PACKAGE_URL "https://github.com/yaml/libyaml" #define YAML_VERSION_MAJOR 0 #define YAML_VERSION_MINOR 1 -#define YAML_VERSION_PATCH 6 -#define YAML_VERSION_STRING "0.1.6" +#define YAML_VERSION_PATCH 7 +#define YAML_VERSION_STRING "0.1.7" Index: ruby_2_3/ext/psych/yaml/parser.c =================================================================== --- ruby_2_3/ext/psych/yaml/parser.c (revision 59241) +++ ruby_2_3/ext/psych/yaml/parser.c (revision 59242) @@ -759,8 +759,9 @@ yaml_parser_parse_block_sequence_entry(y https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/parser.c#L759 else if (token->type == YAML_BLOCK_END_TOKEN) { + yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */ parser->state = POP(parser, parser->states); - (void)POP(parser, parser->marks); + dummy_mark = POP(parser, parser->marks); SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark); SKIP_TOKEN(parser); return 1; @@ -868,8 +869,9 @@ yaml_parser_parse_block_mapping_key(yaml https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/parser.c#L869 else if (token->type == YAML_BLOCK_END_TOKEN) { + yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */ parser->state = POP(parser, parser->states); - (void)POP(parser, parser->marks); + dummy_mark = POP(parser, parser->marks); MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark); SKIP_TOKEN(parser); return 1; @@ -950,6 +952,7 @@ yaml_parser_parse_flow_sequence_entry(ya https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/parser.c#L952 yaml_event_t *event, int first) { yaml_token_t *token; + yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */ if (first) { token = PEEK_TOKEN(parser); @@ -994,7 +997,7 @@ yaml_parser_parse_flow_sequence_entry(ya https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/parser.c#L997 } parser->state = POP(parser, parser->states); - (void)POP(parser, parser->marks); + dummy_mark = POP(parser, parser->marks); SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark); SKIP_TOKEN(parser); return 1; @@ -1101,6 +1104,7 @@ yaml_parser_parse_flow_mapping_key(yaml_ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/psych/yaml/parser.c# (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/