diff options
author | Yang Rong <rong.r.yang@intel.com> | 2016-07-01 17:40:42 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2016-07-04 16:30:36 +0800 |
commit | 850f88595d3e02090acfb40c6ab018cba9cc508f (patch) | |
tree | b8a46664374ebc876f37903c676b154cd370bf42 /backend | |
parent | 1b17896bad794c573e19cec35202921ebc30620d (diff) |
GBE: reorder the condition to avoid array overflow.
Signed-off-by: Yang Rong <rong.r.yang@intel.com>
Reviewed-by: Ruiling Song <ruiling.song@intel.com>
Diffstat (limited to 'backend')
-rw-r--r-- | backend/src/llvm/llvm_loadstore_optimization.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/src/llvm/llvm_loadstore_optimization.cpp b/backend/src/llvm/llvm_loadstore_optimization.cpp index 95c69e02..e797e989 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; } |