Commit 7fcdc31f authored by Victor Yacovlev's avatar Victor Yacovlev

Fixed raise error on void return-value for non-main algorithm

parent 5f12032c
......@@ -2070,13 +2070,13 @@ void KumirVM::do_load(uint8_t s, uint16_t id)
}
bool isRetVal = VariableScope(s)==LOCAL
&& stack_contexts.top().locals[id].algorhitmName()==stack_contexts.top().locals[id].name();
if (isRetVal)
if (isRetVal && stack_contexts.top().type==Bytecode::EL_MAIN)
Variable::unsetError();
if (Kumir::Core::getError().length()==0) {
stack_values.push(val);
if (val.dimension()==0)
register0 = val.value();
if (isRetVal)
if (isRetVal && stack_contexts.top().type==Bytecode::EL_MAIN)
Variable::unsetError();
}
s_error = Kumir::Core::getError();
......
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