From 47e186864bd160752046159dba8124a0d4e0f2e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 12 Jan 2020 15:15:21 +0100 Subject: [PATCH] Clang import; Set function pointer properly --- lib/clangimport.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/clangimport.cpp b/lib/clangimport.cpp index e909a1a73..cca0d902c 100644 --- a/lib/clangimport.cpp +++ b/lib/clangimport.cpp @@ -127,9 +127,11 @@ namespace clangimport { Decl(Token *def, Variable *var) : def(def), function(nullptr), var(var) {} Decl(Token *def, Function *function) : def(def), function(function), var(nullptr) {} void ref(Token *tok) { - tok->function(function); + if (function) + tok->function(function); tok->varId(var ? var->declarationId() : 0); - tok->variable(var); + if (var) + tok->variable(var); } Token *def; Function *function;