lawrancej / CompilerKit

Compiler construction library in C.
GNU Lesser General Public License v2.1
55 stars 33 forks source link

Possible issue with compilerkit_character_class_new #90

Open mueschm opened 12 years ago

mueschm commented 12 years ago

am unsure if this is an intended effect and possibly not just a wrong comment. I apologize for the terrible markdown. I have always been awful with markdown.

/* Don't match NULL in the regex */ if (lo == '\0') { lo++; }

/* This must mean lo and hi are both NULL. Return EmptyString instead. */ else if (hi == '\0') { return compilerkit_empty_string_get_instance(); }

The second conditional will only be met when lo is not null. Though the comment says that in this case we are seeing if both hi and lo are null and if so return an empty set. It does not appear that will be the case though since if lo is null it will increment it by one and then move out of the conditional check without checking the state of hi.