aboutsummaryrefslogtreecommitdiff
path: root/src/stage1/bigint.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-04-23 16:59:01 -0400
committerGitHub <noreply@github.com>2021-04-23 16:59:01 -0400
commita279f18bce488460f87f41545411fc964dcaa4b0 (patch)
treea8680bac63d2812ab764fe5ee4d49f60d08e0d30 /src/stage1/bigint.cpp
parente86a1df9f23386cc315ac8055ecfe7a6465c5ee3 (diff)
parent9ac5f9820086f6760df321b0a1ffc60ec92c8ad8 (diff)
downloadzig-a279f18bce488460f87f41545411fc964dcaa4b0.tar.gz
zig-a279f18bce488460f87f41545411fc964dcaa4b0.zip
Merge pull request #8599 from LemonBoy/unsigned-neg
stage1: Allow wrapping negation on unsigned ints at comptime
Diffstat (limited to 'src/stage1/bigint.cpp')
-rw-r--r--src/stage1/bigint.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stage1/bigint.cpp b/src/stage1/bigint.cpp
index 79a05e95a5..acb3e18e41 100644
--- a/src/stage1/bigint.cpp
+++ b/src/stage1/bigint.cpp
@@ -1446,10 +1446,10 @@ void bigint_negate(BigInt *dest, const BigInt *op) {
bigint_normalize(dest);
}
-void bigint_negate_wrap(BigInt *dest, const BigInt *op, size_t bit_count) {
+void bigint_negate_wrap(BigInt *dest, const BigInt *op, size_t bit_count, bool is_signed) {
BigInt zero;
bigint_init_unsigned(&zero, 0);
- bigint_sub_wrap(dest, &zero, op, bit_count, true);
+ bigint_sub_wrap(dest, &zero, op, bit_count, is_signed);
}
void bigint_not(BigInt *dest, const BigInt *op, size_t bit_count, bool is_signed) {