fix null pointer access in unused.d
This commit is contained in:
parent
1597733f12
commit
e027965176
|
@ -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…
Reference in New Issue