diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-08-26 21:35:37 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-08-26 21:35:37 +0300 |
commit | 3a2e4e1b409d87ade30d3ad2976695235347f13b (patch) | |
tree | a556b87c9bbfbb2fb8522493ed2d9ed92c99691f /regcomp.c | |
parent | 12e05615041147de61658bda8f5e7d5a4acd87c3 (diff) | |
parent | a5847cb0a97b093cd0f23b65c72370af836c9748 (diff) | |
download | egawk-3a2e4e1b409d87ade30d3ad2976695235347f13b.tar.gz egawk-3a2e4e1b409d87ade30d3ad2976695235347f13b.tar.bz2 egawk-3a2e4e1b409d87ade30d3ad2976695235347f13b.zip |
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -2203,7 +2203,11 @@ parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, { branch = parse_branch (regexp, preg, token, syntax, nest, err); if (BE (*err != REG_NOERROR && branch == NULL, 0)) - return NULL; + { + if (tree != NULL) + postorder (tree, free_tree, NULL); + return NULL; + } } else branch = NULL; @@ -2464,8 +2468,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, while (token->type == OP_DUP_ASTERISK || token->type == OP_DUP_PLUS || token->type == OP_DUP_QUESTION || token->type == OP_OPEN_DUP_NUM) { - bin_tree_t *dup_tree = parse_dup_op (tree, regexp, dfa, token, - syntax, err); + bin_tree_t *dup_tree = parse_dup_op (tree, regexp, dfa, token, syntax, err); if (BE (*err != REG_NOERROR && dup_tree == NULL, 0)) { if (tree != NULL) @@ -2628,6 +2631,8 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa, /* Duplicate ELEM before it is marked optional. */ elem = duplicate_tree (elem, dfa); + if (BE (elem == NULL, 0)) + goto parse_dup_op_espace; old_tree = tree; } else @@ -3124,8 +3129,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, if (BE (sbcset == NULL, 0)) #endif /* RE_ENABLE_I18N */ { -#ifdef RE_ENABLE_I18N re_free (sbcset); +#ifdef RE_ENABLE_I18N re_free (mbcset); #endif *err = REG_ESPACE; |