From: Brendan Hansen Date: Wed, 6 Jan 2021 15:46:50 +0000 (-0600) Subject: fixed the broken test case and a gnarly bug X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=5d4b1ad4c4118be865db5ac46a28f0df9ccc12b4;p=onyx.git fixed the broken test case and a gnarly bug --- diff --git a/bin/onyx b/bin/onyx index c30ab5a1..75d65de0 100755 Binary files a/bin/onyx and b/bin/onyx differ diff --git a/onyx.exe b/onyx.exe index e47275a8..512452fb 100644 Binary files a/onyx.exe and b/onyx.exe differ diff --git a/src/onyxtypes.c b/src/onyxtypes.c index d346d960..3d8bb299 100644 --- a/src/onyxtypes.c +++ b/src/onyxtypes.c @@ -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++; } diff --git a/tests/aoc-2020/day14.onyx b/tests/aoc-2020/day14.onyx index 9d23a103..380dc1cc 100644 --- a/tests/aoc-2020/day14.onyx +++ b/tests/aoc-2020/day14.onyx @@ -71,7 +71,6 @@ bitmask_iter_next :: proc (use bmi: ^BitmaskIter) -> u64 { done = true; } - printf("val is %l\n", val); return val; }