From 3d6ced141c4457797a70786187d1cb177189e209 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Wed, 7 Jan 2015 15:26:12 -0800 Subject: [PATCH] Fix range violation --- src/analysis/undocumented.d | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/analysis/undocumented.d b/src/analysis/undocumented.d index 9c56948..c7c1019 100644 --- a/src/analysis/undocumented.d +++ b/src/analysis/undocumented.d @@ -51,10 +51,10 @@ class UndocumentedDeclarationCheck : BaseAnalyzer shouldPop = dec.attributeDeclaration !is null; if (isProtection(attribute.attribute.type)) { - if (dec.attributeDeclaration) - set(attribute.attribute.type); - else + if (shouldPop) push(attribute.attribute.type); + else + set(attribute.attribute.type); } else if (attribute.attribute == tok!"override") ovr = true; @@ -177,7 +177,7 @@ private: stack[$ - 1].isOverride = o; } - bool currentIsInteresting()() + bool currentIsInteresting() { return stack[$ - 1].protection == tok!"public" && !(stack[$ - 1].isOverride); } @@ -198,6 +198,7 @@ private: void pop() { + assert (stack.length > 1); stack = stack[0 .. $ - 1]; }