diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2015-08-17 18:23:20 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2015-08-17 18:23:20 (GMT) |
commit | 341ea00aaa20072fc11f8ee69d9ba66c8958bb39 (patch) | |
tree | b408028784093b73312ff7c8209a68ff1d064ba2 | |
parent | 3ad3a0eae3eb18eb4ee1c2a1a7e42cb6a74b8aa4 (diff) | |
parent | c6028b16417c1d65aa55cc7a1d060bc8fa348701 (diff) | |
download | tcl-341ea00aaa20072fc11f8ee69d9ba66c8958bb39.zip tcl-341ea00aaa20072fc11f8ee69d9ba66c8958bb39.tar.gz tcl-341ea00aaa20072fc11f8ee69d9ba66c8958bb39.tar.bz2 |
[818a1a51e4] Apply fixes from Andreas Seltenreich (reported to us by Tom Lane) for handling low memory situations. Should not be reachable in Tcl due to ckalloc() panic policy.
-rw-r--r-- | generic/regc_nfa.c | 1 | ||||
-rw-r--r-- | generic/regcomp.c | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index 1f0583e..9361d34 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -49,6 +49,7 @@ newnfa( nfa = (struct nfa *) MALLOC(sizeof(struct nfa)); if (nfa == NULL) { + ERR(REG_ESPACE); return NULL; } diff --git a/generic/regcomp.c b/generic/regcomp.c index 7ca4346..4f0c139 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -982,6 +982,7 @@ parseqatom( NOERR(); assert(v->nextvalue > 0); atom = subre(v, 'b', BACKR, lp, rp); + NOERR(); subno = v->nextvalue; atom->subno = subno; EMPTYARC(lp, rp); /* temporarily, so there's something */ @@ -1129,6 +1130,7 @@ parseqatom( */ t = subre(v, '.', COMBINE(qprefer, atom->flags), lp, rp); + NOERR(); t->left = atom; atomp = &t->left; @@ -1142,6 +1144,7 @@ parseqatom( assert(top->op == '=' && top->left == NULL && top->right == NULL); top->left = subre(v, '=', top->flags, top->begin, lp); + NOERR(); top->op = '.'; top->right = t; |