gpr icon indicating copy to clipboard operation
gpr copied to clipboard

parser.cpp segmentation error

Open childhoodisend opened this issue 2 years ago • 1 comments

Hi, @dillonhuff Faced the problem of parsing this non-standard code. M76 X Or something like that, without the address at the end.

There is a segmentation error in the line 249.

string next_next = *(s.remaining() + 1);

Perhaps it's worth checking the presence of the address somehow?

if (s.remaining() + 1 != s.end()) {
    string next_next = *(s.remaining() + 1);

    if (!is_num_char(next_next[0])) {
        return parse_isolated_word(s);
    }

    return parse_word_address(s);
}
return parse_isolated_word(s);

childhoodisend avatar Aug 05 '22 17:08 childhoodisend

related to https://github.com/dillonhuff/gpr/pull/13

childhoodisend avatar Oct 11 '23 13:10 childhoodisend