From: Brendan Hansen Date: Sat, 8 Oct 2022 01:32:11 +0000 (-0500) Subject: tiny bugfixes X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=7f9a7fe2ffc82c39a777a8009e8b9208e72ac416;p=onyx.git tiny bugfixes --- diff --git a/compiler/src/wasm_emit.c b/compiler/src/wasm_emit.c index 6978c6dd..21e36939 100644 --- a/compiler/src/wasm_emit.c +++ b/compiler/src/wasm_emit.c @@ -1619,6 +1619,10 @@ EMIT_FUNC(switch, AstSwitch* switch_node) { WID(switch_node->expr->token, WI_BLOCK_START, 0x40); emit_expression(mod, &code, switch_node->expr); if (switch_node->min_case != 0) { + if (onyx_type_to_wasm_type(switch_node->expr->type) == WASM_TYPE_INT64) { + WI(switch_node->expr->token, WI_I32_FROM_I64); + } + WID(switch_node->expr->token, WI_I32_CONST, switch_node->min_case); WI(switch_node->expr->token, WI_I32_SUB); } diff --git a/core/container/iter.onyx b/core/container/iter.onyx index b3516fdc..d490e7a9 100644 --- a/core/container/iter.onyx +++ b/core/container/iter.onyx @@ -9,7 +9,9 @@ Iterable :: interface (t: $T) { } close :: (it: Iterator($T)) { - it.close(it.data); + if it.close != null_proc { + it.close(it.data); + } } filter :: #match #local {}