From afb6221bf79d7ed59e4a859f147bbed2ea2c3617 Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Tue, 19 Aug 2014 10:52:50 +1000 Subject: [PATCH] cmd/6g: fix undefined behavior in reg.c Update #8527 Fixes, cmd/6g/reg.c:847:24: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' LGTM=minux, rsc R=minux, rsc CC=dvyukov, golang-codereviews https://golang.org/cl/129290043 --- src/cmd/6g/reg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/6g/reg.c b/src/cmd/6g/reg.c index 02945fb4012..5e3a1981861 100644 --- a/src/cmd/6g/reg.c +++ b/src/cmd/6g/reg.c @@ -844,7 +844,7 @@ prop(Reg *r, Bits ref, Bits cal) if(v == v1 || ((cal.b[j/32]>>(j&31))&1) == 0) { for(; v1 != nil; v1 = v1->nextinnode) { j = v1 - var; - cal.b[j/32] |= 1<<(j&31); + cal.b[j/32] |= 1UL<<(j&31); } } }