mirror of https://github.com/vitalif/openscad
Small clarification of Don's Windows parser crash fix
parent
fac508c8cd
commit
ef7ab1c275
18
src/parser.y
18
src/parser.y
|
@ -588,18 +588,16 @@ AbstractModule *parse(const char *text, const char *path, int debug)
|
||||||
if (!module)
|
if (!module)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
std::vector<std::string> to_erase;
|
// Iterating manually since we want to modify the container while iterating
|
||||||
|
Module::ModuleContainer::iterator iter = module->usedlibs.begin();
|
||||||
BOOST_FOREACH(Module::ModuleContainer::value_type &m, module->usedlibs) {
|
while (iter != module->usedlibs.end()) {
|
||||||
module->usedlibs[m.first] = Module::compile_library(m.first);
|
Module::ModuleContainer::iterator curr = iter++;
|
||||||
if (!module->usedlibs[m.first]) {
|
curr->second = Module::compile_library(curr->first);
|
||||||
PRINTF("WARNING: Failed to compile library `%s'.", m.first.c_str());
|
if (!curr->second) {
|
||||||
to_erase.push_back( m.first );
|
PRINTF("WARNING: Failed to compile library `%s'.", curr->first.c_str());
|
||||||
|
module->usedlibs.erase(curr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BOOST_FOREACH( std::string s, to_erase ) {
|
|
||||||
module->usedlibs.erase( s );
|
|
||||||
}
|
|
||||||
|
|
||||||
parser_error_pos = -1;
|
parser_error_pos = -1;
|
||||||
return module;
|
return module;
|
||||||
|
|
Loading…
Reference in New Issue