gp-4641 - MDMang fix infinite loop

This commit is contained in:
ghizard 2024-05-29 16:13:14 +00:00
parent b5e6782db6
commit 2efe1b9e62

View file

@ -97,9 +97,16 @@ public class MDQualification extends MDParsableItem implements Iterable<MDQualif
@Override
protected void parseInternal() throws MDException {
while ((dmang.peek() != MDMang.DONE) && (dmang.peek() != '@')) {
int loc = dmang.getIndex();
MDQualifier qual = new MDQualifier(dmang);
qual.parse();
quals.add(qual);
// This is a quick fix to prevent infinite looping when the next character is not
// expected. TODO: need to work on code the breaks symbols on these other
// characters that we have seen such as '.' and '`'.
if (dmang.getIndex() == loc) {
break;
}
}
if (dmang.peek() == '@') {
dmang.increment(); // Skip past @.