From a012406ca48c9b496093a844e702048d1cb65b7c Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Mon, 3 Feb 2014 20:04:24 -0800 Subject: [PATCH] Fix broken search where member names accidentally match variables. --- symbol_search.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/symbol_search.cc b/symbol_search.cc index c0d2f94949..d27078eb77 100644 --- a/symbol_search.cc +++ b/symbol_search.cc @@ -58,9 +58,9 @@ struct symbol_search_results { NetEvent*eve; }; -bool symbol_search(const LineInfo*li, Design*des, NetScope*scope, - pform_name_t path, struct symbol_search_results*res, - NetScope*start_scope = 0) +static bool symbol_search(const LineInfo*li, Design*des, NetScope*scope, + pform_name_t path, struct symbol_search_results*res, + NetScope*start_scope = 0) { assert(scope); bool prefix_scope = false; @@ -100,6 +100,9 @@ bool symbol_search(const LineInfo*li, Design*des, NetScope*scope, "`" << path_tail.name << "' in path `" << path << "'" << endl; des->errors += 1; } + } else { + // Prefix is present, but is NOT a scope. Fail! + return false; } }