chore: replace asserts with abort to be use NDEBUG

main
Sean McBride 4 years ago
parent 84cdcf7b6c
commit 01d32c19f8

@ -181,7 +181,7 @@ sandbox_state_stringify(sandbox_state_t state)
return "Error"; return "Error";
default: default:
/* Crash, as this should be exclusive */ /* Crash, as this should be exclusive */
assert(0); abort();
} }
} }

@ -1,7 +1,7 @@
#include <assert.h>
#include <pthread.h> #include <pthread.h>
#include <signal.h> #include <signal.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h>
/** /**
* Called by the inline assembly in arch_context_switch to send a SIGUSR1 in order to restore a previously preempted * Called by the inline assembly in arch_context_switch to send a SIGUSR1 in order to restore a previously preempted
@ -12,5 +12,5 @@
void __attribute__((noinline)) __attribute__((noreturn)) arch_context_restore_preempted(void) void __attribute__((noinline)) __attribute__((noreturn)) arch_context_restore_preempted(void)
{ {
pthread_kill(pthread_self(), SIGUSR1); pthread_kill(pthread_self(), SIGUSR1);
assert(false); abort();
} }

@ -1,3 +1,4 @@
#include <stdlib.h>
#include <uv.h> #include <uv.h>
#include "current_sandbox.h" #include "current_sandbox.h"
@ -627,7 +628,7 @@ wasm_fcntl(uint32_t file_descriptor, uint32_t cmd, uint32_t arg_or_lock_ptr)
case WF_SETLK: case WF_SETLK:
return 0; return 0;
default: default:
assert(0); abort();
} }
} }

@ -2,6 +2,7 @@
#include <pthread.h> #include <pthread.h>
#include <signal.h> #include <signal.h>
#include <sched.h> #include <sched.h>
#include <stdlib.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <uv.h> #include <uv.h>
@ -311,5 +312,5 @@ worker_thread_on_sandbox_exit(struct sandbox *exiting_sandbox)
assert(!software_interrupt_is_enabled()); assert(!software_interrupt_is_enabled());
worker_thread_dump_lock_overhead(); worker_thread_dump_lock_overhead();
worker_thread_switch_to_base_context(); worker_thread_switch_to_base_context();
assert(0); abort();
} }

Loading…
Cancel
Save