Fix BackwardsRangeCheck fails on noninteger slice
This commit is contained in:
parent
0acd33f48b
commit
8623c27498
|
@ -74,18 +74,23 @@ class BackwardsRangeCheck : BaseAnalyzer
|
||||||
|
|
||||||
override void visit(const PrimaryExpression primary)
|
override void visit(const PrimaryExpression primary)
|
||||||
{
|
{
|
||||||
|
import std.conv;
|
||||||
|
|
||||||
if (state == State.ignore || !isNumberLiteral(primary.primary.type))
|
if (state == State.ignore || !isNumberLiteral(primary.primary.type))
|
||||||
return;
|
return;
|
||||||
if (state == State.left)
|
if (state == State.left)
|
||||||
{
|
{
|
||||||
line = primary.primary.line;
|
line = primary.primary.line;
|
||||||
this.column = primary.primary.column;
|
this.column = primary.primary.column;
|
||||||
left = parseNumber(primary.primary.text);
|
|
||||||
|
try left = parseNumber(primary.primary.text);
|
||||||
|
catch (ConvException e) return;
|
||||||
hasLeft = true;
|
hasLeft = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
right = parseNumber(primary.primary.text);
|
try right = parseNumber(primary.primary.text);
|
||||||
|
catch (ConvException e) return;
|
||||||
hasRight = true;
|
hasRight = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue