Commit 437855eb authored by Victor Yacovlev's avatar Victor Yacovlev

Fixed emppty globals program run

parent 4e1a021c
......@@ -598,6 +598,12 @@ void KumirVM::setProgram(const Bytecode::Data &program, bool isMain, const Strin
breakpointsTable_.registerSourceFileName(filename, e.module);
}
else if (e.type==EL_INIT ) {
if (moduleContexts_[currentModuleContext].globals.size() <= e.module) {
moduleContexts_[currentModuleContext].globals.resize(e.module + 1);
moduleContexts_[currentModuleContext].globals[e.module].reserve(256);
moduleContexts_[currentModuleContext].moduleNames.resize(e.module + 1);
moduleContexts_[currentModuleContext].moduleNames[e.module] = e.moduleLocalizedName;
}
uint8_t key = e.module;
moduleContexts_[currentModuleContext].inits.push_back(e);
breakpointsTable_.registerSourceFileName(filename, e.module);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment