mirror of
https://github.com/dlang-community/D-Scanner.git
synced 2025-04-27 13:50:02 +03:00
fix null pointer access in unused.d
This commit is contained in:
parent
1597733f12
commit
262329356e
2 changed files with 8 additions and 1 deletions
|
@ -434,7 +434,8 @@ abstract class UnusedStorageCheck : UnusedIdentifierCheck
|
|||
// enum name = "abc";
|
||||
// __traits(hasMember, S, name);
|
||||
ignoreDeclarations++;
|
||||
traitsExp.templateArgumentList.accept(this);
|
||||
if (traitsExp.templateArgumentList)
|
||||
traitsExp.templateArgumentList.accept(this);
|
||||
ignoreDeclarations--;
|
||||
}
|
||||
|
||||
|
|
|
@ -117,6 +117,12 @@ final class UnusedVariableCheck : UnusedStorageCheck
|
|||
__traits(compiles, { int i = 2; });
|
||||
}
|
||||
|
||||
// segfault with null templateArgumentList
|
||||
void nullTest()
|
||||
{
|
||||
__traits(isPOD);
|
||||
}
|
||||
|
||||
}c, sac);
|
||||
stderr.writeln("Unittest for UnusedVariableCheck passed.");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue