diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-14 14:58:48 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-14 14:58:48 +0100 |
| commit | a134307dcde9aac03323c15f8dfc5642f438fe56 (patch) | |
| tree | e00bf06006d2789f931376abb34fb516698cf43f /src/exact_value.cpp | |
| parent | c3b510c2d9adf1a9281285fc711a28187288af75 (diff) | |
Fix issue #72 - 128-bit literal corruption
Diffstat (limited to 'src/exact_value.cpp')
| -rw-r--r-- | src/exact_value.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/exact_value.cpp b/src/exact_value.cpp index ff740a057..ac3d6a23f 100644 --- a/src/exact_value.cpp +++ b/src/exact_value.cpp @@ -76,7 +76,7 @@ ExactValue exact_value_i128(i128 i) { } ExactValue exact_value_u128(u128 i) { ExactValue result = {ExactValue_Integer}; - result.value_integer = *cast(i128 *)&i; + result.value_integer = u128_to_i128(i); return result; } @@ -101,7 +101,7 @@ ExactValue exact_value_pointer(i64 ptr) { ExactValue exact_value_integer_from_string(String string) { - return exact_value_i128(i128_from_string(string)); + return exact_value_u128(u128_from_string(string)); } f64 float_from_string(String string) { |