diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-27 00:44:04 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-27 00:44:04 +0000 |
commit | 867581dd755bd202cefc605af5e081ba2ba8c1ec (patch) | |
tree | 60b9cfa3907cdddfbd5d3ca840a9c6eb32935e50 /ext/psych/yaml/parser.c | |
parent | e0311eb847bfa1c526aac4485889548ad8152ce3 (diff) | |
download | ruby-867581dd755bd202cefc605af5e081ba2ba8c1ec.tar.gz |
Merge psych-3.1.0.pre1.
* Update bundled libyaml-0.2.1 from 0.1.7.
https://github.com/ruby/psych/pull/368
* Unify Psych's API: To use keyword arguments with method call.
https://github.com/ruby/psych/pull/358
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/yaml/parser.c')
-rw-r--r-- | ext/psych/yaml/parser.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/psych/yaml/parser.c b/ext/psych/yaml/parser.c index 32671b252c..621f676bf2 100644 --- a/ext/psych/yaml/parser.c +++ b/ext/psych/yaml/parser.c @@ -605,7 +605,7 @@ yaml_parser_parse_node(yaml_parser_t *parser, yaml_event_t *event, if (strcmp((char *)tag_directive->handle, (char *)tag_handle) == 0) { size_t prefix_len = strlen((char *)tag_directive->prefix); size_t suffix_len = strlen((char *)tag_suffix); - tag = yaml_malloc(prefix_len+suffix_len+1); + tag = YAML_MALLOC(prefix_len+suffix_len+1); if (!tag) { parser->error = YAML_MEMORY_ERROR; goto error; @@ -685,7 +685,7 @@ yaml_parser_parse_node(yaml_parser_t *parser, yaml_event_t *event, return 1; } else if (anchor || tag) { - yaml_char_t *value = yaml_malloc(1); + yaml_char_t *value = YAML_MALLOC(1); if (!value) { parser->error = YAML_MEMORY_ERROR; goto error; @@ -1208,7 +1208,7 @@ yaml_parser_process_empty_scalar(yaml_parser_t *parser, yaml_event_t *event, { yaml_char_t *value; - value = yaml_malloc(1); + value = YAML_MALLOC(1); if (!value) { parser->error = YAML_MEMORY_ERROR; return 0; @@ -1245,7 +1245,7 @@ yaml_parser_process_directives(yaml_parser_t *parser, } tag_directives = { NULL, NULL, NULL }; yaml_token_t *token; - if (!STACK_INIT(parser, tag_directives, INITIAL_STACK_SIZE)) + if (!STACK_INIT(parser, tag_directives, yaml_tag_directive_t*)) goto error; token = PEEK_TOKEN(parser); @@ -1266,7 +1266,7 @@ yaml_parser_process_directives(yaml_parser_t *parser, "found incompatible YAML document", token->start_mark); goto error; } - version_directive = yaml_malloc(sizeof(yaml_version_directive_t)); + version_directive = YAML_MALLOC_STATIC(yaml_version_directive_t); if (!version_directive) { parser->error = YAML_MEMORY_ERROR; goto error; |