diff --git a/vm/jitrino/src/jet/cg.cpp b/vm/jitrino/src/jet/cg.cpp index 7857aac..84beca2 100644 --- a/vm/jitrino/src/jet/cg.cpp +++ b/vm/jitrino/src/jet/cg.cpp @@ -678,6 +678,8 @@ void CodeGen::gen_call_vm_restore(bool e call_va(is_set(DBG_CHECK_STACK), gr, target, cs, idx, valist); runlock(cs); // 4. + // Restore BBState first, so ref_counts for registers become valid + *m_bbstate = saveBB; // restore the registers state for (unsigned i=0; saveScratch && i