Merge change 6660 into donut

* changes:
  Fix a small bug in array length bounds checking.