Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation problem on while true #18

Open
StefanRRichter opened this issue Sep 9, 2015 · 1 comment
Open

Compilation problem on while true #18

StefanRRichter opened this issue Sep 9, 2015 · 1 comment
Assignees
Milestone

Comments

@StefanRRichter
Copy link

Hi,

the following code does not compile for me, except if i change the condition of the while loop to something that is not 'true'. I am using the master branch version.

Code:

fn circular_iteration(sizeLog2 : u64, mut idx : u64, body: fn(u64, fn())) -> () {
    let mask = (1u64 << sizeLog2) - 1u64;
    while true { // this true is triggering the problem
        body(idx);
        idx = (idx + 1u64) & mask;
    }
}

fn main() -> bool {
    for i in circular_iteration(8u64, 42u64) {
        if i == 23u64 {
            break()
        }
        thorin_print_long(i as i64);
        thorin_print_string("\n");
    }
    true
}

Error Message:

impala: /home/srichter/anydsl/anydsl/thorin/src/thorin/analyses/scope.cpp:210: void thorin::Scope::build_rev_rpo(thorin::Array<thorin::Lambda*>): Assertion `n == 0' failed.
@leissa
Copy link
Member

leissa commented Sep 9, 2015

Hi,

thanks for reporting the bug.
This is a known problem. We are working on that, but it will take some time :)

In the mean time, when you just want to get your code working, don't use trivial endless loops.

@leissa leissa self-assigned this Sep 9, 2015
@leissa leissa added this to the 0.4 milestone Sep 9, 2015
@richardmembarth richardmembarth modified the milestones: 0.4, 0.5 Nov 4, 2015
leissa added a commit that referenced this issue Dec 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants