📝 format

This commit is contained in:
ValKmjolnir
2024-12-26 21:02:35 +08:00
parent 94d0ce9c2d
commit 985dee8001
5 changed files with 144 additions and 157 deletions

View File

@@ -536,12 +536,12 @@ void vm::die(const std::string& str) {
if (!ngc.cort) {
// in main context, exit directly
std::exit(1);
} else {
// in coroutine, shut down the coroutine and return to main context
ctx.pc = 0; // mark coroutine 'dead'
ngc.context_reserve(); // switch context to main
ctx.top[0] = nil; // generate return value 'nil'
}
// in coroutine, shut down the coroutine and return to main context
ctx.pc = 0; // mark coroutine 'dead'
ngc.context_reserve(); // switch context to main
ctx.top[0] = nil; // generate return value 'nil'
}
void vm::run(const codegen& gen,