diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-11-24 14:36:16 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-11-24 14:36:16 -0500 |
| commit | 56a8f2b018a6ee1f1116a64d34803511a6fbad80 (patch) | |
| tree | a582577fd9a1cfc6f9364b4ae0b741da928aa5d8 /src | |
| parent | b953e322a857e58df2209ca7ae9e965b9e768887 (diff) | |
| download | zig-56a8f2b018a6ee1f1116a64d34803511a6fbad80.tar.gz zig-56a8f2b018a6ee1f1116a64d34803511a6fbad80.zip | |
fix @intCast not catching negative numbers to unsigned
Diffstat (limited to 'src')
| -rw-r--r-- | src/codegen.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index 40f71e38fe..096552037d 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -1645,7 +1645,7 @@ static LLVMValueRef gen_widen_or_shorten(CodeGen *g, bool want_runtime_safety, Z zig_unreachable(); } - if (actual_bits >= wanted_bits && actual_type->id == ZigTypeIdInt && + if (actual_type->id == ZigTypeIdInt && !wanted_type->data.integral.is_signed && actual_type->data.integral.is_signed && want_runtime_safety) { |
