Skip to content

Apparent write beyond end of buffer in jit-compiled code #7343

Closed
@abadams

Description

@abadams

The following code writes beyond the end of Buffer r0 inside the JIT-compiled code. Given the schedule, I believe the minimum viable output size is 1024 + 16, starting at -1, not 1024 starting at zero, so it should be failing a bounds check, but it's not.

    Var x;
    const int size = 1024;
    Func h;
    h(x) = {0, 0};
    RDom r(0, size);
    h(r) = {h(r - 1)[0], 0};

    Var xo, xi;
    h.split(x, xo, xi, 16, TailStrategy::RoundUp);

    Buffer<int> r0(size);
    Buffer<int> r1(size);
    h.realize({r0, r1});

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions