Changes to elab_type.c

Changes for "Microsoft Visual Studio Express 2015 RC Web" to first check for a dereferencable iterator so pr1741212.v, and many others, will pass with a DEBUG build.
This commit is contained in:
Frederick C. Kurz 2015-07-10 12:50:37 -04:00 committed by Stephen Williams
parent 9635f031a1
commit 9bcafe39c6
1 changed files with 2 additions and 2 deletions

View File

@ -81,8 +81,8 @@ ivl_type_s* data_type_t::elaborate_type(Design*des, NetScope*scope)
use_definitions = des;
map<Definitions*,ivl_type_s*>::iterator pos = cache_type_elaborate_.lower_bound(use_definitions);
if (pos->first == use_definitions)
return pos->second;
if (pos != cache_type_elaborate_.end() && pos->first == use_definitions)
return pos->second;
ivl_type_s*tmp = elaborate_type_raw(des, scope);
cache_type_elaborate_.insert(pos, pair<NetScope*,ivl_type_s*>(scope, tmp));