- Patch #1535500: fix segfault in BZ2File.writelines and make sure it
raises the correct exceptions.
+- Make regex engine raise MemoryError if allocating memory fails.
+
- Bug #1471938: Fix curses module build problem on Solaris 8; patch by
Paul Eggert.
/* install new repeat context */
ctx->u.rep = (SRE_REPEAT*) malloc(sizeof(*ctx->u.rep));
- /* XXX(nnorwitz): anything else we need to do on error? */
- if (!ctx->u.rep)
+ if (!ctx->u.rep) {
+ PyErr_NoMemory();
RETURN_FAILURE;
+ }
ctx->u.rep->count = -1;
ctx->u.rep->pattern = ctx->pattern;
ctx->u.rep->prev = state->repeat;
}
TRACE(("|%p|%p|END\n", PatternObject_GetCode(self), state.ptr));
+ if (PyErr_Occurred())
+ return NULL;
state_fini(&state);
state_fini(&state);
+ if (PyErr_Occurred())
+ return NULL;
+
return pattern_new_match(self, &state, status);
}
#endif
}
+ if (PyErr_Occurred())
+ goto error;
+
if (status <= 0) {
if (status == 0)
break;
#endif
}
+ if (PyErr_Occurred())
+ goto error;
+
if (status <= 0) {
if (status == 0)
break;
#endif
}
+ if (PyErr_Occurred())
+ goto error;
+
if (status <= 0) {
if (status == 0)
break;
status = sre_umatch(state, PatternObject_GetCode(self->pattern));
#endif
}
+ if (PyErr_Occurred())
+ return NULL;
match = pattern_new_match((PatternObject*) self->pattern,
state, status);
status = sre_usearch(state, PatternObject_GetCode(self->pattern));
#endif
}
+ if (PyErr_Occurred())
+ return NULL;
match = pattern_new_match((PatternObject*) self->pattern,
state, status);