diff --git a/PScope.h b/PScope.h index 4e356cede..b6c31791a 100644 --- a/PScope.h +++ b/PScope.h @@ -72,7 +72,7 @@ class LexicalScope { // Packages that are wildcard imported. When identifiers from // these packages are referenced, they will be added to the // explicit imports (IEEE 1800-2012 26.3). - std::setpotential_imports; + std::listpotential_imports; // A task or function call may reference a task or function defined // later in the scope. So here we stash the potential imports for diff --git a/pform.cc b/pform.cc index 34cd4042b..a04c301de 100644 --- a/pform.cc +++ b/pform.cc @@ -478,7 +478,7 @@ static PPackage*find_potential_import(const struct vlltype&loc, LexicalScope*sco assert(scope); PPackage*found_pkg = 0; - for (set::const_iterator cur_pkg = scope->potential_imports.begin(); + for (list::const_iterator cur_pkg = scope->potential_imports.begin(); cur_pkg != scope->potential_imports.end(); ++cur_pkg) { PPackage*search_pkg = *cur_pkg; map::const_iterator cur_sym diff --git a/pform_package.cc b/pform_package.cc index 100ae6b42..4acccce2d 100644 --- a/pform_package.cc +++ b/pform_package.cc @@ -124,10 +124,12 @@ void pform_package_import(const struct vlltype&loc, PPackage*pkg, const char*ide scope->explicit_imports[use_ident] = pkg; } else { - set::const_iterator cur_pkg - = scope->potential_imports.find(pkg); + list::const_iterator cur_pkg + = find(scope->potential_imports.begin(), + scope->potential_imports.end(), + pkg); if (cur_pkg == scope->potential_imports.end()) - scope->potential_imports.insert(pkg); + scope->potential_imports.push_back(pkg); } }