mirror of
https://github.com/odin-lang/Odin.git
synced 2026-08-18 03:12:10 +00:00
Fix bit_set upper endpoint representability check
This commit is contained in:
@@ -1368,7 +1368,7 @@ gb_internal void check_bit_set_type(CheckerContext *c, Type *type, Type *named_t
|
||||
gb_free(a, s.text);
|
||||
return;
|
||||
}
|
||||
if (!check_representable_as_constant(c, iv, t, nullptr)) {
|
||||
if (!check_representable_as_constant(c, jv, t, nullptr)) {
|
||||
gbAllocator a = heap_allocator();
|
||||
String s = big_int_to_string(a, &j);
|
||||
gbString ts = type_to_string(t);
|
||||
|
||||
@@ -107,6 +107,13 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $($ODIN check ../test_issue_7304.odin -no-entry-point $COMMON_CHECK 2>&1 >/dev/null | grep -c "9223372036854775808 is not representable by int") -eq 1 ]]; then
|
||||
echo "SUCCESSFUL 1/1"
|
||||
else
|
||||
echo "SUCCESSFUL 0/1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
clang -c ../test_issue_7010.c -o test_issue_7010_c.o
|
||||
$ODIN test ../test_issue_7010.odin $COMMON
|
||||
|
||||
|
||||
4
tests/issues/test_issue_7304.odin
Normal file
4
tests/issues/test_issue_7304.odin
Normal file
@@ -0,0 +1,4 @@
|
||||
// Tests issue #7304 https://github.com/odin-lang/Odin/issues/7304
|
||||
package test_issues
|
||||
|
||||
Bad_Bit_Set :: bit_set[-1 ..< 9223372036854775808]
|
||||
Reference in New Issue
Block a user