added assert in linkBasicBlocks()