Skip to content

parser.cpp segmentation error #11

@childhoodisend

Description

@childhoodisend

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions