initialize involved_set to an empty HList, not NULL
This commit is contained in:
parent
0497cdb08b
commit
ce88a3f49d
1 changed files with 4 additions and 2 deletions
|
|
@ -77,7 +77,9 @@ HParserCacheValue* recall(HParserCacheKey *k, HParseState *state) {
|
||||||
void setupLR(const HParser *p, HParseState *state, HLeftRec *rec_detect) {
|
void setupLR(const HParser *p, HParseState *state, HLeftRec *rec_detect) {
|
||||||
if (!rec_detect->head) {
|
if (!rec_detect->head) {
|
||||||
HRecursionHead *some = a_new(HRecursionHead, 1);
|
HRecursionHead *some = a_new(HRecursionHead, 1);
|
||||||
some->head_parser = p; some->involved_set = NULL; some->eval_set = NULL;
|
some->head_parser = p;
|
||||||
|
some->involved_set = h_slist_new(state->arena);
|
||||||
|
some->eval_set = NULL;
|
||||||
rec_detect->head = some;
|
rec_detect->head = some;
|
||||||
}
|
}
|
||||||
assert(state->lr_stack->head != NULL);
|
assert(state->lr_stack->head != NULL);
|
||||||
|
|
@ -101,7 +103,7 @@ HParseResult* grow(HParserCacheKey *k, HParseState *state, HRecursionHead *head)
|
||||||
HParseResult *old_res = old_cached->right->result;
|
HParseResult *old_res = old_cached->right->result;
|
||||||
|
|
||||||
// reset the eval_set of the head of the recursion at each beginning of growth
|
// reset the eval_set of the head of the recursion at each beginning of growth
|
||||||
head->eval_set = head->involved_set;
|
head->eval_set = head->involved_set; // BUG: this must be a copy
|
||||||
HParseResult *tmp_res = perform_lowlevel_parse(state, k->parser);
|
HParseResult *tmp_res = perform_lowlevel_parse(state, k->parser);
|
||||||
|
|
||||||
if (tmp_res) {
|
if (tmp_res) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue