From 8d3dcc55bcff5c0a5a392336e70457cf39e8aa36 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Tue, 27 Nov 2018 14:40:12 +0100 Subject: [PATCH] fix #723 - segfault when running D-Scanner master against dparse repo with -S --- src/dscanner/analysis/unused.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dscanner/analysis/unused.d b/src/dscanner/analysis/unused.d index 42ddcb9..141164f 100644 --- a/src/dscanner/analysis/unused.d +++ b/src/dscanner/analysis/unused.d @@ -308,9 +308,11 @@ final class UnusedVariableCheck : BaseAnalyzer override void visit(const WithStatement withStatetement) { interestDepth++; - withStatetement.expression.accept(this); + if (withStatetement.expression) + withStatetement.expression.accept(this); interestDepth--; - withStatetement.declarationOrStatement.accept(this); + if (withStatetement.declarationOrStatement) + withStatetement.declarationOrStatement.accept(this); } override void visit(const Parameter parameter)