add some array bounds check optimizations
Merge pull request #3620 from WalterBright/bounds

add some array bounds check optimizations
fix pull #3620
Merge pull request #3656 from WalterBright/fixpull3620

fix pull #3620