mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-19 19:10:17 +00:00
add p0 assert
This commit is contained in:
parent
1ab175006d
commit
fb93b2bc8b
@ -158,12 +158,14 @@ bool py_matchexc(py_Type type) {
|
||||
void py_clearexc(py_StackRef p0) {
|
||||
VM* vm = pk_current_vm;
|
||||
py_newnil(&vm->unhandled_exc);
|
||||
if(p0) vm->stack.sp = p0;
|
||||
if(p0) {
|
||||
c11__rtassert(p0 >= vm->stack.begin && p0 <= vm->stack.sp);
|
||||
vm->stack.sp = p0;
|
||||
}
|
||||
}
|
||||
|
||||
static void c11_sbuf__write_exc(c11_sbuf* self, py_Ref exc) {
|
||||
if(true) { c11_sbuf__write_cstr(self, "Traceback (most recent call last):\n"); }
|
||||
|
||||
c11_sbuf__write_cstr(self, "Traceback (most recent call last):\n");
|
||||
BaseException* ud = py_touserdata(exc);
|
||||
|
||||
for(int i = ud->stacktrace.length - 1; i >= 0; i--) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user