Fix the access out of bounds in gencomposetable

TEST=src/gencomposetable

Review URL: https://codereview.appspot.com/52670044