aboutsummaryrefslogtreecommitdiff
path: root/src/glibc.cpp
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-04-19 11:38:42 +0200
committerAndrew Kelley <andrew@ziglang.org>2020-04-19 06:46:33 -0400
commit328eb8ed8dfdc646df28f899267c76e18645da40 (patch)
tree2f5e0cb482da5a0b2a328ee54cf5ec3c9519de54 /src/glibc.cpp
parent051620dcaf7df2f0dafb721a192dc5fb9f899987 (diff)
downloadzig-328eb8ed8dfdc646df28f899267c76e18645da40.tar.gz
zig-328eb8ed8dfdc646df28f899267c76e18645da40.zip
stage1: Fix signed multiplication overflow
Spotted thanks to UBSan
Diffstat (limited to 'src/glibc.cpp')
-rw-r--r--src/glibc.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glibc.cpp b/src/glibc.cpp
index b78e140e1d..2456cab44c 100644
--- a/src/glibc.cpp
+++ b/src/glibc.cpp
@@ -362,9 +362,9 @@ Error glibc_build_dummies_and_maps(CodeGen *g, const ZigGLibCAbi *glibc_abi, con
}
uint32_t hash_glibc_target(const ZigTarget *x) {
- return x->arch * 3250106448 +
- x->os * 542534372 +
- x->abi * 59162639;
+ return x->arch * (uint32_t)3250106448 +
+ x->os * (uint32_t)542534372 +
+ x->abi * (uint32_t)59162639;
}
bool eql_glibc_target(const ZigTarget *a, const ZigTarget *b) {