AnyDSL / thorin

The Higher-Order Intermediate Representation
https://anydsl.github.io
GNU Lesser General Public License v3.0
150 stars 15 forks source link

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

Open madmann91 opened 7 years ago

madmann91 commented 7 years ago

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);
    }
}
leissa commented 7 years ago

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.