-Resolved bug that made yield() not work in some situations, fixes #884
This commit is contained in:
parent
f75ae815d5
commit
bd03562076
3 changed files with 22 additions and 2 deletions
|
@ -738,6 +738,26 @@ static void _disassemble_class(const Ref<GDScript>& p_class,const Vector<String>
|
|||
incr=4+argc;
|
||||
|
||||
} break;
|
||||
case GDFunction::OPCODE_YIELD: {
|
||||
|
||||
txt+=" yield ";
|
||||
incr=1;
|
||||
|
||||
} break;
|
||||
case GDFunction::OPCODE_YIELD_SIGNAL: {
|
||||
|
||||
txt+=" yield_signal ";
|
||||
txt+=DADDR(1);
|
||||
txt+=",";
|
||||
txt+=DADDR(2);
|
||||
incr=3;
|
||||
} break;
|
||||
case GDFunction::OPCODE_YIELD_RESUME: {
|
||||
|
||||
txt+=" yield resume: ";
|
||||
txt+=DADDR(1);
|
||||
incr=2;
|
||||
} break;
|
||||
case GDFunction::OPCODE_JUMP: {
|
||||
|
||||
txt+=" jump ";
|
||||
|
|
|
@ -528,7 +528,7 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre
|
|||
int ret = _parse_expression(codegen,on->arguments[i],slevel);
|
||||
if (ret<0)
|
||||
return ret;
|
||||
if (ret&GDFunction::ADDR_TYPE_STACK<<GDFunction::ADDR_BITS) {
|
||||
if (ret&(GDFunction::ADDR_TYPE_STACK<<GDFunction::ADDR_BITS)) {
|
||||
slevel++;
|
||||
codegen.alloc_stack(slevel);
|
||||
}
|
||||
|
|
|
@ -820,7 +820,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
|
|||
gdfs->state.stack.resize(alloca_size);
|
||||
//copy variant stack
|
||||
for(int i=0;i<_stack_size;i++) {
|
||||
memnew_placement(&stack[sizeof(Variant)*i],Variant(stack[i]));
|
||||
memnew_placement(&gdfs->state.stack[sizeof(Variant)*i],Variant(stack[i]));
|
||||
}
|
||||
gdfs->state.stack_size=_stack_size;
|
||||
gdfs->state.self=self;
|
||||
|
|
Loading…
Reference in a new issue