mirror of https://gitlab.com/basile.b/dexed.git
dastworx, prevent unsafe access
This commit is contained in:
parent
e79930576b
commit
4a0e037c51
|
@ -80,8 +80,14 @@ private final class ImportLister: ASTVisitor
|
|||
|
||||
override void visit(const ConditionalDeclaration decl)
|
||||
{
|
||||
const VersionCondition ver = decl.compileCondition.versionCondition;
|
||||
if (ver is null || ver.token.text !in badVersions)
|
||||
bool acc = true;
|
||||
if (decl.compileCondition)
|
||||
{
|
||||
const ver = decl.compileCondition.versionCondition;
|
||||
if (ver && ver.token.text in badVersions)
|
||||
acc = false;
|
||||
}
|
||||
if (acc)
|
||||
decl.accept(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,8 +35,14 @@ private final class MainFunctionDetector: ASTVisitor
|
|||
|
||||
override void visit(const ConditionalDeclaration decl)
|
||||
{
|
||||
const VersionCondition ver = decl.compileCondition.versionCondition;
|
||||
if (ver is null || ver.token.text !in badVersions)
|
||||
bool acc = true;
|
||||
if (decl.compileCondition)
|
||||
{
|
||||
const ver = decl.compileCondition.versionCondition;
|
||||
if (ver && ver.token.text in badVersions)
|
||||
acc = false;
|
||||
}
|
||||
if (acc)
|
||||
decl.accept(this);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue