avoid a segfault on getting the token position
This commit is contained in:
parent
ce387d81b6
commit
41d4be4b84
1 changed files with 7 additions and 3 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue