handle dynamic indexes properly, even out of bounds, for array gep lookups; fixes #865