Parser segfaults when missing ; from end of line

Issue #82 resolved
Laurie Nevay created an issue

If a block of text in an input gmad file is missing a semi-colon from the end of line, bdsim / the parser segfaults.

It is not strictly required to put a semicolon at the end of a line as the 'block' may be continued on the next line before another declaration / keyword.

The parser should not segfault but exit safely.

Error:

option, beampipeThickness = 1*mm
option, checkOverlaps = 1;

Valid:

option, beampipeThickness = 1*mm,
            checkOverlaps = 1;

So the first would be valid without the 'option' keyword.

I don't believe we should omit the requirement of a semicolon, but just fix in this particular case.

Comments (3)

  1. Jochem Snuverink

    thanks for reporting. Could you check if this is still there with the latest version of develop? I hadn't realised that just yesterday I had fixed it actually.

  2. Log in to comment