mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-05-02 19:00:47 +08:00
🐛 fix segfault when callsite is empty
This commit is contained in:
@@ -263,6 +263,11 @@ void vm::function_call_trace() {
|
|||||||
std::clog << " at " << files[bytecode[ctx.pc].fidx] << ":";
|
std::clog << " at " << files[bytecode[ctx.pc].fidx] << ":";
|
||||||
std::clog << bytecode[ctx.pc].line << "\n";
|
std::clog << bytecode[ctx.pc].line << "\n";
|
||||||
|
|
||||||
|
if (callsite.empty()) {
|
||||||
|
cp.restore_code_page();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const nas_func* prev = nullptr;
|
const nas_func* prev = nullptr;
|
||||||
u64 prev_addr = 0;
|
u64 prev_addr = 0;
|
||||||
u64 same_call_count = 0;
|
u64 same_call_count = 0;
|
||||||
|
|||||||
3
test/backtrace/empty_callsite.nas
Normal file
3
test/backtrace/empty_callsite.nas
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
use std.math;
|
||||||
|
|
||||||
|
math.clamp();
|
||||||
Reference in New Issue
Block a user