We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87da3b7 commit 08f01deCopy full SHA for 08f01de
lib/SILOptimizer/Utils/ConstantFolding.cpp
@@ -1665,7 +1665,8 @@ void ConstantFolder::initializeWorklist(SILFunction &f) {
1665
// to be folded, if needed.
1666
if (auto *floatLit = dyn_cast<FloatLiteralInst>(inst)) {
1667
APFloat fpVal = floatLit->getValue();
1668
- if (EnableDiagnostics && fpVal.isInfinity()) {
+ if (EnableDiagnostics && fpVal.isInfinity() &&
1669
+ floatLit->getLoc().getAsASTNode<FloatLiteralExpr>()) {
1670
SmallString<10> litStr;
1671
tryExtractLiteralText(floatLit, litStr);
1672
diagnose(inst->getModule().getASTContext(), inst->getLoc().getSourceLoc(),
0 commit comments