Skip to content

Commit 42cb5fe

Browse files
committed
special-case s8 and u8 in Binary.md
Special case `s8` and `u8` to ensure that exactly 1 byte is used to represent values of those types #336 (comment) Signed-off-by: Roman Volosatovs <[email protected]>
1 parent 4400af7 commit 42cb5fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

design/mvp/Binary.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ Notes:
361361
value ::= t:<valtype> v:<val(t)> => (value t v)
362362
val(bool) ::= 0x00 => false
363363
| 0x01 => true
364-
val(u8) ::= v:<core:u8> => v
365-
val(s8) ::= v:<core:s8> => v
364+
val(u8) ::= v:<core:byte> => v
365+
val(s8) ::= v:<core:byte> => v if v < 128 else (v - 256)
366366
val(s16) ::= v:<core:s16> => v
367367
val(u16) ::= v:<core:u16> => v
368368
val(s32) ::= v:<core:s32> => v

0 commit comments

Comments
 (0)