avoid a segfault on getting the token position

This commit is contained in:
Sven M. Hallberg 2013-06-12 15:54:46 +02:00
parent ce387d81b6
commit 41d4be4b84

View file

@ -690,9 +690,13 @@ HParseResult *h_lr_parse(HAllocator* mm__, const HParser* parser, HInputStream*
value->seq->elements[len-1-i] = v; value->seq->elements[len-1-i] = v;
value->seq->used++; value->seq->used++;
} }
// result position equals position of left-most symbol if(v) {
value->index = v->index; // result position equals position of left-most symbol
value->bit_offset = v->bit_offset; value->index = v->index;
value->bit_offset = v->bit_offset;
} else {
// XXX how to get the position in this case?
}
// perform token reshape if indicated // perform token reshape if indicated
if(symbol->reshape) if(symbol->reshape)