Merge pull request #254 from WalterWaldron/fix242fix
unused_label: Fix crash on empty label statement
This commit is contained in:
commit
fd4b4edda9
|
@ -95,7 +95,8 @@ class UnusedLabelCheck : BaseAnalyzer
|
||||||
label.line = token.line;
|
label.line = token.line;
|
||||||
label.column = token.column;
|
label.column = token.column;
|
||||||
}
|
}
|
||||||
labeledStatement.declarationOrStatement.accept(this);
|
if (labeledStatement.declarationOrStatement !is null)
|
||||||
|
labeledStatement.declarationOrStatement.accept(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void labelUsed(string name)
|
void labelUsed(string name)
|
||||||
|
@ -165,6 +166,7 @@ unittest
|
||||||
}();
|
}();
|
||||||
F: // [warn]: Label "F" is not used.
|
F: // [warn]: Label "F" is not used.
|
||||||
return x;
|
return x;
|
||||||
|
G: // [warn]: Label "G" is not used.
|
||||||
}
|
}
|
||||||
}c, sac);
|
}c, sac);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue