dimitriv / Ziria

A domain-specific-language and compiler for low-level bitstream processing.
92 stars 18 forks source link

Static analyzer fails with a weird error #110

Open bradunov opened 9 years ago

bradunov commented 9 years ago

The following code:

fun test() {
    var k : int;
    let (a : arr[4] int) = {1,3,5,7};
    k := 2;
    while (k < length(a) && a[k] != 8) {
        k := k + 1;
    }
    return k;
}
let comp main = read[int] >>> emit test() >>> write[int];

failed to compile with the following error (I presume from Edsko's static analyser): user error (Program failure during evaluation: Out of boundsnoLoc)

The code is correct if we assume the usual precedence of conditions. The problem is in current master 120d726a5c