[IR] Add bounds checking to paramHasAttr