harlan icon indicating copy to clipboard operation
harlan copied to clipboard

Add bounds checking

Open calvis opened this issue 13 years ago • 4 comments

Harlan should be memory safe, but it's not if we don't check to make sure array accesses are in bounds.

We currently check (some) vector-refs, but we do not check the lengths of kernel arguments.

calvis avatar Apr 28 '12 17:04 calvis

This was spuriously closed by a commit message from IU's internal github.

eholk avatar Apr 28 '12 17:04 eholk

Oh my dear IU github, how silly you are.

calvis avatar Apr 28 '12 18:04 calvis

I think we should move our remove-danger pass even further down in the compiler, because it's responsible for some code explosion before the region inferencer.

I suggest having a different primitive for those vector-refs created by the compiler that we know are safe (something like, say, safe-vector-ref). That way, we can avoid adding way too many checks if remove-danger runs near the backend.

calvis avatar Jun 05 '12 20:06 calvis

This sounds good to me.

eholk avatar Jun 05 '12 20:06 eholk