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 963edb7 commit e1f4057Copy full SHA for e1f4057
lib/SILOptimizer/Utils/ConstantFolding.cpp
@@ -1886,7 +1886,8 @@ void ConstantFolder::initializeWorklist(SILFunction &f) {
1886
// to be folded, if needed.
1887
if (auto *floatLit = dyn_cast<FloatLiteralInst>(inst)) {
1888
APFloat fpVal = floatLit->getValue();
1889
- if (EnableDiagnostics && fpVal.isInfinity()) {
+ if (EnableDiagnostics && fpVal.isInfinity() &&
1890
+ floatLit->getLoc().getAsASTNode<FloatLiteralExpr>()) {
1891
SmallString<10> litStr;
1892
tryExtractLiteralText(floatLit, litStr);
1893
diagnose(inst->getModule().getASTContext(), inst->getLoc().getSourceLoc(),
0 commit comments