🐛 fix segfault when callsite is empty

This commit is contained in:
ValKmjolnir
2025-09-26 22:37:38 +08:00
parent 4a03179457
commit 8ccb5c36b8
2 changed files with 8 additions and 0 deletions

View File

@@ -263,6 +263,11 @@ void vm::function_call_trace() {
std::clog << " at " << files[bytecode[ctx.pc].fidx] << ":";
std::clog << bytecode[ctx.pc].line << "\n";
if (callsite.empty()) {
cp.restore_code_page();
return;
}
const nas_func* prev = nullptr;
u64 prev_addr = 0;
u64 same_call_count = 0;

View File

@@ -0,0 +1,3 @@
use std.math;
math.clamp();