Browse Source

Fix unaligned store for rand

Jeroen van Rijn 1 year ago
parent
commit
91cc006e8f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      base/runtime/random_generator.odin

+ 1 - 1
base/runtime/random_generator.odin

@@ -89,7 +89,7 @@ default_random_generator_proc :: proc(data: rawptr, mode: Random_Generator_Mode,
 		switch len(p) {
 		case size_of(u64):
 			// Fast path for a 64-bit destination.
-			(transmute(^u64)raw_data(p))^ = read_u64(r)
+			intrinsics.unaligned_store(transmute(^u64)raw_data(p), read_u64(r))
 		case:
 			// All other cases.
 			pos := i8(0)