diff --git a/src/compiler/compiler.cpp b/src/compiler/compiler.cpp index 83465042..1424b173 100644 --- a/src/compiler/compiler.cpp +++ b/src/compiler/compiler.cpp @@ -64,13 +64,13 @@ Error* Compiler::pop_context() noexcept{ } // pre-compute LOOP_BREAK and LOOP_CONTINUE for(int i = 0; i < codes.count; i++) { - Bytecode bc = c11__getitem(Bytecode, &codes, i); - if(bc.op == OP_LOOP_CONTINUE) { - CodeBlock* block = c11__at(CodeBlock, &ctx()->co->blocks, bc.arg); - Bytecode__set_signed_arg(&bc, block->start - i); - } else if(bc.op == OP_LOOP_BREAK) { - CodeBlock* block = c11__at(CodeBlock, &ctx()->co->blocks, bc.arg); - Bytecode__set_signed_arg(&bc, (block->end2 != -1 ? block->end2 : block->end) - i); + Bytecode* bc = c11__at(Bytecode, &codes, i); + if(bc->op == OP_LOOP_CONTINUE) { + CodeBlock* block = c11__at(CodeBlock, &ctx()->co->blocks, bc->arg); + Bytecode__set_signed_arg(bc, block->start - i); + } else if(bc->op == OP_LOOP_BREAK) { + CodeBlock* block = c11__at(CodeBlock, &ctx()->co->blocks, bc->arg); + Bytecode__set_signed_arg(bc, (block->end2 != -1 ? block->end2 : block->end) - i); } } // pre-compute func->is_simple diff --git a/src/interpreter/frame.cpp b/src/interpreter/frame.cpp index 650519e9..22c8deee 100644 --- a/src/interpreter/frame.cpp +++ b/src/interpreter/frame.cpp @@ -54,8 +54,7 @@ int Frame::_exit_block(ValueStack* _s, int i) { void Frame::prepare_jump_break(ValueStack* _s, int target) { int i = c11__at(BytecodeEx, &co->codes_ex, ip())->iblock; if(target >= co->codes.count) { - while(i >= 0) - i = _exit_block(_s, i); + while(i >= 0) i = _exit_block(_s, i); } else { // BUG (solved) // for i in range(4): diff --git a/src/interpreter/vm.cpp b/src/interpreter/vm.cpp index ed21e7ea..904c0d65 100644 --- a/src/interpreter/vm.cpp +++ b/src/interpreter/vm.cpp @@ -858,7 +858,7 @@ void VM::__log_s_data(const char* title) { }); Frame* frame = &callstack.top(); int line = frame->curr_lineno(); - ss << frame->co->name << ":" << line << " ["; + ss << pkpy_Str__data(&frame->co->name) << ":" << line << " ["; for(PyVar* p = s_data.begin(); p != s_data.end(); p++) { ss << std::string(sp_bases[p], '|'); if(sp_bases[p] > 0) ss << " "; @@ -869,9 +869,9 @@ void VM::__log_s_data(const char* title) { case tp_none_type: ss << "None"; break; case tp_int: ss << _CAST(i64, *p); break; case tp_float: ss << _CAST(f64, *p); break; - case tp_bool: ss << (p->_bool ? "True" : "False"); break; + case tp_bool: ss << (p->extra ? "True" : "False"); break; case tp_str: ss << _CAST(Str, *p).escape(); break; - case tp_function: ss << p->obj_get().decl->code->name << "()"; break; + case tp_function: ss << pkpy_Str__data(&p->obj_get().decl->code->name) << "()"; break; case tp_type: ss << "obj_get()).escape() + ">"; break; case tp_list: ss << "list(size=" << p->obj_get().size() << ")"; break; case tp_tuple: ss << "tuple(size=" << p->obj_get().size() << ")"; break;