From 2877ce4ae25bf785c96d43bee2eb84db20dbe9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hillerstr=C3=B6m?= Date: Mon, 10 Apr 2023 18:23:12 +0200 Subject: [PATCH] Change opcode for cont (#28) --- interpreter/binary/decode.ml | 2 +- interpreter/binary/encode.ml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/interpreter/binary/decode.ml b/interpreter/binary/decode.ml index 604b3f26..ca2c2020 100644 --- a/interpreter/binary/decode.ml +++ b/interpreter/binary/decode.ml @@ -206,7 +206,7 @@ let cont_type s = let def_type s = match s7 s with | -0x20 -> DefFuncT (func_type s) - | -0x21 -> DefContT (cont_type s) + | -0x23 -> DefContT (cont_type s) (* TODO(dhil): See comment in encode.ml *) | _ -> error s (pos s - 1) "malformed definition type" diff --git a/interpreter/binary/encode.ml b/interpreter/binary/encode.ml index 2745ae8a..85ac4196 100644 --- a/interpreter/binary/encode.ml +++ b/interpreter/binary/encode.ml @@ -134,7 +134,10 @@ struct let def_type = function | DefFuncT ft -> s7 (-0x20); func_type ft - | DefContT ct -> s7 (-0x21); cont_type ct (* TODO(dhil): I think the GC proposal claims opcode -0x21 for one of the struct/array types. *) + | DefContT ct -> s7 (-0x23); cont_type ct + (* TODO(dhil): This might need to change again in the future as a + different proposal might claim this opcode! GC proposal claimed + the previous opcode we were using. *) let limits vu {min; max} = bool (max <> None); vu min; opt vu max