From: Ken Thompson Date: Fri, 22 Oct 2010 01:15:00 +0000 (-0700) Subject: bug right shifting 64 bits X-Git-Tag: weekly.2010-10-27~48 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e5bd12ea90bd5a5727f51ade05c87962ca390670;p=gostls13.git bug right shifting 64 bits by a variable that equals 32 R=rsc CC=golang-dev https://golang.org/cl/2645042 --- diff --git a/src/cmd/5g/cgen64.c b/src/cmd/5g/cgen64.c index a22f4a548c..716ec5ed5b 100644 --- a/src/cmd/5g/cgen64.c +++ b/src/cmd/5g/cgen64.c @@ -439,12 +439,12 @@ olsh_break: p3 = gbranch(ABLO, T); // shift == 32 + p1 = gins(AMOVW, &bh, &al); + p1->scond = C_SCOND_EQ; if(bh.type->etype == TINT32) p1 = gshift(AMOVW, &bh, SHIFT_AR, 31, &ah); else - p1 = gins(AEOR, &al, &al); - p1->scond = C_SCOND_EQ; - p1 = gins(AMOVW, &bh, &al); + p1 = gins(AEOR, &ah, &ah); p1->scond = C_SCOND_EQ; p4 = gbranch(ABEQ, T);