diff --git a/ml-proto/src/spec/memory.ml b/ml-proto/src/spec/memory.ml index 7f337fccd6..93afc3dc44 100644 --- a/ml-proto/src/spec/memory.ml +++ b/ml-proto/src/spec/memory.ml @@ -92,7 +92,8 @@ let load64 mem a = Int64.logor (Int64.of_int32 (load32 mem a)) (Int64.shift_left (Int64.of_int32 (load32 mem (a+4))) 32) let store8 mem a bits = - !mem.{a} <- Int32.to_int (Int32.logand bits (Int32.of_int 255)) + (* Store the lowest 8 bits of "bits" at byte index a, discarding the rest. *) + !mem.{a} <- Int32.to_int bits let store16 mem a bits = store8 mem (a+0) bits;