This is called committing the milder of the two evils such as eating a carcass in fear of death, and this happens when committing fornication is very likely to occur.