Fixed out of bounds access leading to crashes on exit for some tests.
Fixed out of bounds access leading to crashes on exit for some tests.

psuriana/Halide,kgnk/Halide,ronen/Halide,ronen/Halide,jiawen/Halide,jiawen/Halide,ronen/Halide,ronen/Halide,kgnk/Halide,kgnk/Halide,kgnk/Halide,jiawen/Halide,jiawen/Halide,psuriana/Halide,psuriana/Halide,kgnk/Halide,kgnk/Halide,kgnk/Halide,jiawen/Halide,jiawen/Halide,kgnk/Halide,psuriana/Halide,ronen/Halide,psuriana/Halide,ronen/Halide,jiawen/Halide,ronen/Halide,ronen/Halide,psuriana/Halide,psuriana/Halide