diff --git a/benchmarks/sum.py b/benchmarks/sum.py new file mode 100644 index 00000000..a4382c09 --- /dev/null +++ b/benchmarks/sum.py @@ -0,0 +1,6 @@ +def f(n): + if n == 0: + return 0 + return n + f(n-1) + +assert f(900) == 405450 \ No newline at end of file diff --git a/src/vm.h b/src/vm.h index 39054278..cb82baca 100644 --- a/src/vm.h +++ b/src/vm.h @@ -897,7 +897,9 @@ inline PyObject* VM::_exec(){ bool need_raise = false; while(true){ +#if DEBUG_EXTRA_CHECK if(frame->id < base_id) UNREACHABLE(); +#endif try{ if(need_raise){ need_raise = false; _raise(); } PyObject* ret = run_frame(frame);