AnyDSL / thorin

The Higher-Order Intermediate Representation

Home Page:https://anydsl.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assertion `!pred->arg(index) && "already set"'

madmann91 opened this issue · comments

The following code triggers the assertion (using impala and -emit-thorin):

struct Blob {
    done: fn () -> bool
}

fn test(next_blob: Blob) -> () {
    let next = |exit| {
        next_blob
    };

    let mut blob : Blob;
    while !blob.done() {
        blob = next(continue);
    }
}

The problem ist that the continue continuation is passed as argument to next. Impala's emit doesn't handle this at the moment.

So actually, it's a bug in Impala.