This commit is contained in:
Hackerpilot 2014-08-20 17:26:52 -07:00
commit 05bc2e5ac3
2 changed files with 4 additions and 1 deletions

View File

@ -26,7 +26,8 @@ class AsmStyleCheck : BaseAnalyzer
override void visit(const AsmBrExp brExp)
{
if (brExp.asmBrExp !is null)
if (brExp.asmBrExp !is null && brExp.asmBrExp.asmUnaExp !is null
&& brExp.asmBrExp.asmUnaExp.asmPrimaryExp !is null)
{
addErrorMessage(brExp.line, brExp.column, "dscanner.confusing.brexp",
"This is confusing because it looks like an array index. Rewrite a[1] as [a + 1] to clarify.");
@ -46,6 +47,7 @@ unittest
asm
{
mov a, someArray[1]; // [warn]: This is confusing because it looks like an array index. Rewrite a[1] as [a + 1] to clarify.
add near ptr [EAX], 3;
}
}
}c, sac);

View File

@ -1044,6 +1044,7 @@ class XMLPrinter : ASTVisitor
override void visit(const PragmaDeclaration pragmaDeclaration) { mixin (tagAndAccept!"pragmaDeclaration"); }
override void visit(const PragmaExpression pragmaExpression) { mixin (tagAndAccept!"pragmaExpression"); }
override void visit(const PrimaryExpression primaryExpression) { mixin (tagAndAccept!"primaryExpression"); }
override void visit(const Register register) { mixin (tagAndAccept!"register"); }
override void visit(const ScopeGuardStatement scopeGuardStatement) { mixin (tagAndAccept!"scopeGuardStatement"); }
override void visit(const SharedStaticConstructor sharedStaticConstructor) { mixin (tagAndAccept!"sharedStaticConstructor"); }
override void visit(const SharedStaticDestructor sharedStaticDestructor) { mixin (tagAndAccept!"sharedStaticDestructor"); }