fixed the broken test case and a gnarly bug
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Wed, 6 Jan 2021 15:46:50 +0000 (09:46 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Wed, 6 Jan 2021 15:46:50 +0000 (09:46 -0600)
bin/onyx
onyx.exe
src/onyxtypes.c
tests/aoc-2020/day14.onyx

index c30ab5a1437ed471a470bcf639172d30365b0e20..75d65de0283e28d944bf073842f5e26ec67bb665 100755 (executable)
Binary files a/bin/onyx and b/bin/onyx differ
index e47275a89f782ea3125511cd3a7958af34eeeb54..512452fb5000ffb1b48c997066ebfd0608948d1e 100644 (file)
Binary files a/onyx.exe and b/onyx.exe differ
index d346d960031bf0ff41ea2cc7c488fca79ef5ad73..3d8bb299f180536a300039c8d463d181d3067d7c 100644 (file)
@@ -395,8 +395,8 @@ Type* type_build_from_ast(bh_allocator alloc, AstType* type_node) {
                 u32 type_size = type_size_of((*member)->type);
 
                 if (!is_union) offset += type_size;
-                if (!is_union) size += type_size;
-                else           size =  bh_max(size, type_size);
+                if (!is_union) size = offset;
+                else           size = bh_max(size, type_size);
 
                 idx++;
             }
index 9d23a1030dca8a6fe6c3f5471deb8dfdae702640..380dc1cce008570f57c2625619ef05315f9141db 100644 (file)
@@ -71,7 +71,6 @@ bitmask_iter_next :: proc (use bmi: ^BitmaskIter) -> u64 {
                done = true;
        }
 
-       printf("val is %l\n", val);
        return val;
 }