From b16c29f5200a66e671e3e1462b2c2ea5da7bdb77 Mon Sep 17 00:00:00 2001 From: LukeZhu Date: Mon, 14 Aug 2017 17:24:21 +0800 Subject: [PATCH] Fix the bug of vector subscript out of range --- lib/array.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/array.cpp b/lib/array.cpp index a2b0f08157b1..075eeedcb73b 100644 --- a/lib/array.cpp +++ b/lib/array.cpp @@ -862,7 +862,7 @@ expression_tree dot(LTYPE const & x, RTYPE const & y)\ throw semantic_error("matrices are not aligned");\ std::vector shapedata(std::max(1,xs.size()-1 + ys.size()-1));\ for(size_t i = 0 ; i < shapedata.size() ; ++i){\ - if(i < xs.size() - 1) shapedata[i] = xs[i];\ + if(i <= xs.size() - 1) shapedata[i] = xs[i];\ else shapedata[i] = ys[i - xs.size() + 2];\ }\ tuple rshape(shapedata);\