bugfixes with structs by value
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 18 Sep 2020 17:03:10 +0000 (12:03 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 18 Sep 2020 17:03:10 +0000 (12:03 -0500)
onyx
src/onyxwasm.c

diff --git a/onyx b/onyx
index f93ebfa0ee1d072eff795630ebba246a78d2290b..c41cd073c25e09d636b0bef226da90c1d0a137fd 100755 (executable)
Binary files a/onyx and b/onyx differ
index f3cdc524e95f3daf5c2b24548d018ffe9c68f741..df11a30f8d5c7a69c1ed9d32750b7327cf1e77a0 100644 (file)
@@ -922,7 +922,7 @@ EMIT_FUNC(for_array, AstFor* for_node, u64 iter_local) {
     WI(WI_BLOCK_END);
 
     WIL(WI_LOCAL_GET, ptr_local);
-    if (elem_size != 1) {
+    if (elem_size != 0) {
         WIL(WI_I32_CONST, elem_size);
         WI(WI_I32_ADD);
     }
@@ -1020,7 +1020,7 @@ EMIT_FUNC(for_slice, AstFor* for_node, u64 iter_local) {
     WI(WI_BLOCK_END);
 
     WIL(WI_LOCAL_GET, ptr_local);
-    if (elem_size != 1) {
+    if (elem_size != 0) {
         WIL(WI_I32_CONST, elem_size);
         WI(WI_I32_ADD);
     }