Fix out of bounds access in hasStructRetAttr