diff --git a/lib/libesp32/Berry/src/be_exec.c b/lib/libesp32/Berry/src/be_exec.c index 8ed0bc8f1..7b741e4ff 100644 --- a/lib/libesp32/Berry/src/be_exec.c +++ b/lib/libesp32/Berry/src/be_exec.c @@ -74,6 +74,9 @@ struct filebuf { void be_throw(bvm *vm, int errorcode) { +#if BE_USE_PERF_COUNTERS + vm->counter_exc++; +#endif if (vm->errjmp) { vm->errjmp->status = errorcode; exec_throw(vm->errjmp); diff --git a/lib/libesp32/Berry/src/be_vm.c b/lib/libesp32/Berry/src/be_vm.c index fabba9220..6f30835d5 100644 --- a/lib/libesp32/Berry/src/be_vm.c +++ b/lib/libesp32/Berry/src/be_vm.c @@ -1019,9 +1019,6 @@ newframe: /* a new call frame */ dispatch(); } opcase(RAISE): { -#if BE_USE_PERF_COUNTERS - vm->counter_exc++; -#endif if (IGET_RA(ins) < 2) { /* A==2 means no arguments are passed to RAISE, i.e. rethrow with current exception */ bvalue *top = vm->top; top[0] = *RKB(); /* push the exception value to top */