OSDN Git Service

Fix for array lower-bound check for count-down loops.
authorBen Cheng <bccheng@android.com>
Tue, 26 Oct 2010 03:54:31 +0000 (20:54 -0700)
committerBen Cheng <bccheng@android.com>
Tue, 26 Oct 2010 03:54:31 +0000 (20:54 -0700)
commit36bd13455b1e28c3918ced442f225e775363239e
tree0c98c7eb81b2884283cb27168f4785e0239aa065
parent2e3ec7160b265d520cd755f8c20163410d822373
Fix for array lower-bound check for count-down loops.

If the counted loop is composed as

for (int i = hi; i >= lo; i--) {
    .. = array[i];
}

The hoisted lower-bound check should be asserting "lo >= 0".
On the other hand if the counted loop is composed as

for (int i = hi; i > lo; i--) {
    .. = array[i];
}

The hoisted lower-bound check should be asserting "lo + 1 >= 0".
Previously these two checks are reversed.

Bug: 3130818
Change-Id: Ibc5a6daa837880e9986e45bbc29d1a5e548be3ae
vm/compiler/Loop.c