authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-04-19 11:38:42+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-04-19 06:46:33-04:00
log328eb8ed8dfdc646df28f899267c76e18645da40
tree2f5e0cb482da5a0b2a328ee54cf5ec3c9519de54
parent051620dcaf7df2f0dafb721a192dc5fb9f899987

stage1: Fix signed multiplication overflow

Spotted thanks to UBSan

1 files changed, 3 insertions(+), 3 deletions(-)

src/glibc.cpp+3-3
...@@ -362,9 +362,9 @@ Error glibc_build_dummies_and_maps(CodeGen *g, const ZigGLibCAbi *glibc_abi, con...@@ -362,9 +362,9 @@ Error glibc_build_dummies_and_maps(CodeGen *g, const ZigGLibCAbi *glibc_abi, con
362}362}
363363
364uint32_t hash_glibc_target(const ZigTarget *x) {364uint32_t hash_glibc_target(const ZigTarget *x) {
365 return x->arch * 3250106448 +365 return x->arch * (uint32_t)3250106448 +
366 x->os * 542534372 +366 x->os * (uint32_t)542534372 +
367 x->abi * 59162639;367 x->abi * (uint32_t)59162639;
368}368}
369369
370bool eql_glibc_target(const ZigTarget *a, const ZigTarget *b) {370bool eql_glibc_target(const ZigTarget *a, const ZigTarget *b) {