diff --git a/ml-proto/src/spec/memory.ml b/ml-proto/src/spec/memory.ml index 16181ec418..3543c9571f 100644 --- a/ml-proto/src/spec/memory.ml +++ b/ml-proto/src/spec/memory.ml @@ -91,7 +91,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;