Don't crash if function is not found.

This commit is contained in:
Stephen Williams 2013-05-31 19:37:41 -07:00
parent bc77a19059
commit 096e53dea4
2 changed files with 8 additions and 0 deletions

View File

@ -2054,6 +2054,12 @@ NetExpr* PECallFunction::elaborate_expr_method_(Design*des, NetScope*scope,
perm_string method_name = peek_tail_name(use_path);
use_path.pop_back();
// If there is no object to the left of the method name, then
// give up on the idea of looking for an object method.
if (use_path.empty()) {
return 0;
}
NetNet *net = 0;
const NetExpr *par;
NetEvent *eve;

View File

@ -65,6 +65,8 @@ bool symbol_search(const LineInfo*li, Design*des, NetScope*scope,
assert(scope);
bool prefix_scope = false;
bool recurse_flag = false;
ivl_assert(*li, ! path.empty());
name_component_t path_tail = path.back();
path.pop_back();