summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2015-08-17 18:22:18 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2015-08-17 18:22:18 (GMT)
commit2ef36c8edb60b8da26aeb9947f6d2cdd1d4bf6c1 (patch)
tree8e721b0330c2757bffcc01d1738789dfce9d8ea1
parent07ee24f589ea3b7d220a8fa59fc23481062a2c12 (diff)
downloadtcl-2ef36c8edb60b8da26aeb9947f6d2cdd1d4bf6c1.zip
tcl-2ef36c8edb60b8da26aeb9947f6d2cdd1d4bf6c1.tar.gz
tcl-2ef36c8edb60b8da26aeb9947f6d2cdd1d4bf6c1.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.c1
-rw-r--r--generic/regcomp.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c
index 2de7e14..1d572c3 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 77f2f20..d23076b 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;