Commit 69cb3443 authored by Victor Yacovlev's avatar Victor Yacovlev

Fixed no return value for main algorithm

parent 7700a0f1
...@@ -218,6 +218,8 @@ bool Run::makeInputArgument(Variable & reference) ...@@ -218,6 +218,8 @@ bool Run::makeInputArgument(Variable & reference)
} }
bool Run::makeOutputArgument(const Variable & reference) { bool Run::makeOutputArgument(const Variable & reference) {
if (!reference.isValid())
return true;
QString repr; QString repr;
emit output(QString::fromStdWString(reference.name())+" = "); emit output(QString::fromStdWString(reference.name())+" = ");
if (reference.dimension()==0) { if (reference.dimension()==0) {
......
...@@ -2048,6 +2048,8 @@ void KumirVM::do_store(uint8_t s, uint16_t id) ...@@ -2048,6 +2048,8 @@ void KumirVM::do_store(uint8_t s, uint16_t id)
if (m_externalHandler) if (m_externalHandler)
m_externalHandler->noticeOnValueChange(lineNo, qn); m_externalHandler->noticeOnValueChange(lineNo, qn);
} }
if (stack_contexts.top().type==Bytecode::EL_BELOWMAIN)
Variable::unsetError();
s_error = Kumir::Core::getError(); s_error = Kumir::Core::getError();
nextIP(); nextIP();
if (m_dontTouchMe) m_dontTouchMe->unlock(); if (m_dontTouchMe) m_dontTouchMe->unlock();
......
...@@ -226,6 +226,8 @@ bool InteractionHandler::makeInputArgument(VM::Variable &reference) ...@@ -226,6 +226,8 @@ bool InteractionHandler::makeInputArgument(VM::Variable &reference)
} }
bool InteractionHandler::makeOutputArgument(const VM::Variable & reference) { bool InteractionHandler::makeOutputArgument(const VM::Variable & reference) {
if (!reference.isValid())
return true;
Kumir::String repr; Kumir::String repr;
output(reference.name()+Kumir::Core::fromAscii(" = ")); output(reference.name()+Kumir::Core::fromAscii(" = "));
if (reference.dimension()==0) { if (reference.dimension()==0) {
......
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