Manual says "The yield of the function is a pointer to a private data structure that contains the compiled pattern, or NULL if an error was detected". I can see that it's really unexpected to fail, but assert() is unsuitable since it's not a programmer's error. Maybe use  UnexpectedError() and skip mailing?