LGTM. The condition check should be in the new order. Thanks! Ruiling
> -----Original Message----- > From: Beignet [mailto:beignet-boun...@lists.freedesktop.org] On Behalf Of > Yang Rong > Sent: Friday, July 1, 2016 5:41 PM > To: beignet@lists.freedesktop.org > Cc: Yang, Rong R <rong.r.y...@intel.com> > Subject: [Beignet] [PATCH] GBE: reorder the condition to avoid array overflow. > > Signed-off-by: Yang Rong <rong.r.y...@intel.com> > --- > backend/src/llvm/llvm_loadstore_optimization.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/backend/src/llvm/llvm_loadstore_optimization.cpp > b/backend/src/llvm/llvm_loadstore_optimization.cpp > index 95c69e0..e797e98 100644 > --- a/backend/src/llvm/llvm_loadstore_optimization.cpp > +++ b/backend/src/llvm/llvm_loadstore_optimization.cpp > @@ -257,7 +257,7 @@ namespace gbe { > unsigned size = toBeDeleted.size(); > if (reorder) { > unsigned i = 0; > - while (toBeDeleted[i] == &*safe && i < size) { > + while (i < size && toBeDeleted[i] == &*safe) { > ++i; > ++safe; > } > -- > 2.1.4 > > _______________________________________________ > Beignet mailing list > Beignet@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/beignet _______________________________________________ Beignet mailing list Beignet@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/beignet