Merge pull request #560 from wilzbach/fix-18409

Fix Issue 18409 - DScanner SEGFAULTS on CircleCI
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
This commit is contained in:
The Dlang Bot 2018-02-09 18:15:29 +01:00 committed by GitHub
commit 2873322e5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -45,7 +45,8 @@ class IncorrectInfiniteRangeCheck : BaseAnalyzer
if (fb.bodyStatement !is null)
visit(fb.bodyStatement.blockStatement);
else
visit(fb.blockStatement);
if (fb.blockStatement !is null)
visit(fb.blockStatement);
}
override void visit(const BlockStatement bs)
@ -109,6 +110,12 @@ unittest
{
return false;
}
// https://issues.dlang.org/show_bug.cgi?id=18409
struct Foo
{
~this() nothrow @nogc;
}
}
bool empty() { return false; }
@ -116,5 +123,6 @@ class C { bool empty() { return false; } } // [warn]: %1$s
}c
.format(IncorrectInfiniteRangeCheck.MESSAGE), sac);
stderr.writeln("Unittest for IncorrectInfiniteRangeCheck passed.");
}