Added overrun protection
This commit is contained in:
parent
d6c0eaf3de
commit
dc0a7572f7
3 changed files with 29 additions and 2 deletions
|
|
@ -72,6 +72,8 @@ parse_result_t* do_parse(const parser_t* parser, parse_state_t *state) {
|
|||
// It doesn't exist... run the
|
||||
parse_result_t *res;
|
||||
res = parser->fn(parser->env, state);
|
||||
if (state->input.overrun)
|
||||
res = NULL; // overrun is always failure.
|
||||
// update the cache
|
||||
g_hash_table_replace(state->cache, &key, res);
|
||||
#ifdef CONSISTENCY_CHECK
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue