/* install new repeat context */
ctx->u.rep = (SRE_REPEAT*) PyObject_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);