move print_vmStack to DEBUG_VM-only
This commit is contained in:
parent
6f7e82e52b
commit
10671c446d
@ -9,6 +9,9 @@
|
||||
bool please_tail_call_err = true;
|
||||
|
||||
void before_exit(void);
|
||||
#if DEBUG_VM
|
||||
void print_vmStack(void);
|
||||
#endif
|
||||
GLOBAL bool inErr;
|
||||
NORETURN NOINLINE void fatal(char* s) {
|
||||
NOGC_E;
|
||||
@ -27,7 +30,9 @@ NORETURN NOINLINE void fatal(char* s) {
|
||||
fputs(s, stderr); fflush(stderr);
|
||||
fputc('\n', stderr); fflush(stderr);
|
||||
vm_pstLive(); fflush(stderr); fflush(stdout);
|
||||
print_vmStack(); fflush(stderr);
|
||||
#if DEBUG_VM
|
||||
print_vmStack(); fflush(stderr);
|
||||
#endif
|
||||
before_exit();
|
||||
#if DEBUG || USE_VALGRIND
|
||||
__builtin_trap();
|
||||
|
||||
1
src/h.h
1
src/h.h
@ -429,7 +429,6 @@ void freeThrown(void);
|
||||
|
||||
#define VTY(X,T) assert(isVal(X) && TY(X)==(T))
|
||||
|
||||
void print_vmStack(void);
|
||||
#if DEBUG
|
||||
B validate(B x);
|
||||
Value* validateP(Value* x);
|
||||
|
||||
8
src/vm.c
8
src/vm.c
@ -1194,13 +1194,13 @@ static void allocStack(void** curr, void** start, void** end, i32 elSize, i32 co
|
||||
mprotect(*end, ps, PROT_NONE); // idk first way i found to force erroring on overflow
|
||||
#endif
|
||||
}
|
||||
void print_vmStack() {
|
||||
#if DEBUG_VM
|
||||
#if DEBUG_VM
|
||||
void print_vmStack() {
|
||||
printf("vm stack:");
|
||||
for (i32 i = 0; i < (bcDepth>>1) + 1; i++) { printf(" %d", vmStack[i]); fflush(stdout); }
|
||||
printf("\n"); fflush(stdout);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
GLOBAL B oomMessage;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user