From e5279e94f76b92d0a5df613f883eba9c95e52b00 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Fri, 9 Oct 2015 14:54:28 -0700 Subject: [PATCH] Fix #286 --- src/analysis/unmodified.d | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/analysis/unmodified.d b/src/analysis/unmodified.d index 5743aa4..6839c0a 100644 --- a/src/analysis/unmodified.d +++ b/src/analysis/unmodified.d @@ -174,6 +174,13 @@ class UnmodifiedFinder:BaseAnalyzer // issue #270: Ignore unmodified variables inside of `typeof` expressions } + override void visit(const AsmStatement a) + { + inAsm = true; + a.accept(this); + inAsm = false; + } + private: template PartsMightModify(T) @@ -193,7 +200,7 @@ private: if (guaranteeUse == 0) { auto r = tree[index].equalRange(&vi); - if (!r.empty && r.front.isValueType) + if (!r.empty && r.front.isValueType && !inAsm) return; } while (true) @@ -289,6 +296,8 @@ private: int isImmutable; + bool inAsm; + RedBlackTree!(VariableInfo*, "a.name < b.name")[] tree; }