Fix range violation

This commit is contained in:
Hackerpilot 2015-01-07 15:26:12 -08:00
parent 5180a5b857
commit 3d6ced141c
1 changed files with 5 additions and 4 deletions

View File

@ -51,10 +51,10 @@ class UndocumentedDeclarationCheck : BaseAnalyzer
shouldPop = dec.attributeDeclaration !is null; shouldPop = dec.attributeDeclaration !is null;
if (isProtection(attribute.attribute.type)) if (isProtection(attribute.attribute.type))
{ {
if (dec.attributeDeclaration) if (shouldPop)
set(attribute.attribute.type);
else
push(attribute.attribute.type); push(attribute.attribute.type);
else
set(attribute.attribute.type);
} }
else if (attribute.attribute == tok!"override") else if (attribute.attribute == tok!"override")
ovr = true; ovr = true;
@ -177,7 +177,7 @@ private:
stack[$ - 1].isOverride = o; stack[$ - 1].isOverride = o;
} }
bool currentIsInteresting()() bool currentIsInteresting()
{ {
return stack[$ - 1].protection == tok!"public" && !(stack[$ - 1].isOverride); return stack[$ - 1].protection == tok!"public" && !(stack[$ - 1].isOverride);
} }
@ -198,6 +198,7 @@ private:
void pop() void pop()
{ {
assert (stack.length > 1);
stack = stack[0 .. $ - 1]; stack = stack[0 .. $ - 1];
} }