diff --git a/base/runtime/wasm_allocator.odin b/base/runtime/wasm_allocator.odin index f4b399c47..6bafaa489 100644 --- a/base/runtime/wasm_allocator.odin +++ b/base/runtime/wasm_allocator.odin @@ -297,7 +297,8 @@ lock :: proc(a: ^WASM_Allocator) { return } - assert(intrinsics.wasm_memory_atomic_wait32((^u32)(&a.mu), u32(new_state), -1) != 0) + ret := intrinsics.wasm_memory_atomic_wait32((^u32)(&a.mu), u32(new_state), -1) + assert(ret != 0) intrinsics.cpu_relax() } } diff --git a/core/encoding/cbor/marshal.odin b/core/encoding/cbor/marshal.odin index 022e297e9..6657807f5 100644 --- a/core/encoding/cbor/marshal.odin +++ b/core/encoding/cbor/marshal.odin @@ -351,7 +351,8 @@ _marshal_into_encoder :: proc(e: Encoder, v: any, ti: ^runtime.Type_Info) -> (er builder := strings.builder_from_slice(res[:]) e.writer = strings.to_stream(&builder) - assert(_encode_u64(e, u64(len(str)), .Text) == nil) + err := _encode_u64(e, u64(len(str)), .Text) + assert(err == nil) res[9] = u8(len(builder.buf)) assert(res[9] < 10) return diff --git a/core/encoding/cbor/unmarshal.odin b/core/encoding/cbor/unmarshal.odin index 4da2d5a93..c54660839 100644 --- a/core/encoding/cbor/unmarshal.odin +++ b/core/encoding/cbor/unmarshal.odin @@ -96,7 +96,8 @@ _unmarshal_value :: proc(d: Decoder, v: any, hdr: Header, allocator := context.a ti = reflect.type_info_base(variant) if !reflect.is_pointer_internally(variant) { tag := any{rawptr(uintptr(v.data) + u.tag_offset), u.tag_type.id} - assert(_assign_int(tag, 1)) + assigned := _assign_int(tag, 1) + assert(assigned) } } } diff --git a/core/testing/runner.odin b/core/testing/runner.odin index fa7c2ffd2..c27c2124a 100644 --- a/core/testing/runner.odin +++ b/core/testing/runner.odin @@ -654,8 +654,8 @@ runner :: proc(internal_tests: []Internal_Test) -> bool { #no_bounds_check pkg := report.packages_by_name[it.pkg] pkg.frame_ready = false - fmt.assertf(thread.pool_stop_task(&pool, test_index), - "A signal (%v) was raised to stop test #%i %s.%s, but it was unable to be found.", + found := thread.pool_stop_task(&pool, test_index) + fmt.assertf(found, "A signal (%v) was raised to stop test #%i %s.%s, but it was unable to be found.", reason, test_index, it.pkg, it.name) // The order this is handled in is a little particular. diff --git a/core/thread/thread_unix.odin b/core/thread/thread_unix.odin index 363f50862..f56454bfc 100644 --- a/core/thread/thread_unix.odin +++ b/core/thread/thread_unix.odin @@ -81,9 +81,12 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread { defer unix.pthread_attr_destroy(&attrs) // NOTE(tetra, 2019-11-01): These only fail if their argument is invalid. - assert(unix.pthread_attr_setdetachstate(&attrs, unix.PTHREAD_CREATE_JOINABLE) == 0) + res: i32 + res = unix.pthread_attr_setdetachstate(&attrs, unix.PTHREAD_CREATE_JOINABLE) + assert(res == 0) when ODIN_OS != .Haiku && ODIN_OS != .NetBSD { - assert(unix.pthread_attr_setinheritsched(&attrs, unix.PTHREAD_EXPLICIT_SCHED) == 0) + res = unix.pthread_attr_setinheritsched(&attrs, unix.PTHREAD_EXPLICIT_SCHED) + assert(res == 0) } thread := new(Thread) @@ -94,7 +97,6 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread { // Set thread priority. policy: i32 - res: i32 when ODIN_OS != .Haiku && ODIN_OS != .NetBSD { res = unix.pthread_attr_getschedpolicy(&attrs, &policy) assert(res == 0) diff --git a/vendor/wgpu/wgpu_js.odin b/vendor/wgpu/wgpu_js.odin index f375a0d69..3c8375adb 100644 --- a/vendor/wgpu/wgpu_js.odin +++ b/vendor/wgpu/wgpu_js.odin @@ -22,5 +22,6 @@ wgpu_alloc :: proc "contextless" (size: i32) -> [^]byte { @(private="file", export) wgpu_free :: proc "contextless" (ptr: rawptr) { context = g_context - assert(free(ptr) == nil, "wgpu_free failed") + err := free(ptr) + assert(err == nil, "wgpu_free failed") }