Update Standard Library; Fix Type_Info for integers

This commit is contained in:
Ginger Bill
2016-09-28 00:07:03 +01:00
parent 6088cbeddb
commit 5f6b0942f4
12 changed files with 175 additions and 158 deletions
+2 -1
View File
@@ -1200,6 +1200,7 @@ b32 check_value_is_expressible(Checker *c, ExactValue in_value, Type *type, Exac
return false;
if (out_value) *out_value = v;
i64 i = v.value_integer;
u64 u = *cast(u64 *)&i;
i64 s = 8*type_size_of(c->sizes, c->allocator, type);
u64 umax = ~0ull;
if (s < 64) {
@@ -1221,7 +1222,7 @@ b32 check_value_is_expressible(Checker *c, ExactValue in_value, Type *type, Exac
case Basic_u32:
case Basic_u64:
case Basic_uint:
return !(i < 0 || cast(u64)i > umax);
return !(u < 0 || u > umax);
case Basic_UntypedInteger:
return true;