fix(library/module): module index assignment

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-07-19 20:57:27 +01:00
parent 8b70ffb0a4
commit 55db3aaaa1

View file

@ -241,6 +241,7 @@ struct import_modules_fn {
auto d = load_module_file(i); auto d = load_module_file(i);
d->m_dependents.push_back(r); d->m_dependents.push_back(r);
} }
r->m_module_idx = m_next_module_idx++;
if (imports.empty()) if (imports.empty())
add_import_module_task(r); add_import_module_task(r);
@ -302,7 +303,6 @@ struct import_modules_fn {
} }
void import_module(module_info_ptr const & r) { void import_module(module_info_ptr const & r) {
r->m_module_idx = m_next_module_idx++;
std::string s(r->m_obj_code.data(), r->m_obj_code.size()); std::string s(r->m_obj_code.data(), r->m_obj_code.size());
std::istringstream in(s, std::ios_base::binary); std::istringstream in(s, std::ios_base::binary);
deserializer d(in); deserializer d(in);