-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compilecode.c: Use _compilecode() to calculate the code size.
Also change re1_5_sizecode() to return -1 on error. Note: Previously it couldn't return error indication, so existing programs must now check its returned value for error. Also optimize _compilecode() for size (in this particular case it also saves cycles). The total change still adds about 45 bytes (x86_64). Benefits: - Error detection in re1.5_compilecode() (returns -1) when invoked on erroneous regexps, to prevent invoking re1.5_compilecode() with potentially insufficient code size in such a case. - No need to maintain additional separate code when changing re1.5_compilecode(). - Using the same code to calculate the regexp code size and to generate it ensures the same result for regexp code size. - Less source code.
- Loading branch information
Showing
1 changed file
with
63 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters