Skip to content

Infinite assert loop with try/finally #23739

Description

@Herringway
void main() {
    try assert(0);
    finally assert(0);
}

With DMD 2.112, this will print far more (possibly infinitely more) than the expected two stack traces, at least on linux. On windows, it appears to hang instead.

The same result is observed with the equivalent in scope statements:

void main() {
    scope(exit) assert(0);
    assert(0);
}

This problem also exists in GCC 16.2.1 and LDC 1.42.0, pointing to a frontend issue. I could not test if this was a regression - run.dlang.io REALLY does not like running this program, unsurprisingly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions