• Thank you very much. After a bit of experimenting, I'm currently trying to find out, why the following function hangs indefinitly. It's a function which scans a portion (from this.idx to this.next) of an array for a given sequence, starting at an offset using a given stepping width.

    find(sequence, offset, stepping) {
            "jit";
            if (stepping === undefined) {
                stepping = 1;
            }
    
            if (offset === undefined) {
                offset = 0;
            }
    
            for (let i = this.idx + offset; i < this.next - sequence.length; i+=stepping) {
                if (this.buffer[i] !== sequence[0]) {
                    continue;
                }
                
                let idx = i;
    
                for (let j = 1; j < sequence.length; j++) {
                    if (this.buffer[i + j] !== sequence[j]) {
                        idx = -1;
                        // JIT lacks break statement
                        j = sequence.length - 1;
                    }
                }
    
                if (idx !== -1) {
                    return idx;
                }
            }
    
            return -1;
        }
    

    When I run it without jit it works as expected. If the function is jitted, the application hangs without any error. Thank you for your reply

About

Avatar for llakie @llakie started