File tree
5 files changed
+43
-2
lines changed- src/cmd
- 6g
- 8g
- test/fixedbugs
5 files changed
+43
-2
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
943 | 943 |
| |
944 | 944 |
| |
945 | 945 |
| |
946 |
| - | |
| 946 | + | |
947 | 947 |
| |
948 | 948 |
| |
949 | 949 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
838 | 838 |
| |
839 | 839 |
| |
840 | 840 |
| |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
841 | 846 |
| |
842 | 847 |
| |
843 | 848 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
991 | 991 |
| |
992 | 992 |
| |
993 | 993 |
| |
994 |
| - | |
| 994 | + | |
995 | 995 |
| |
996 | 996 |
| |
997 | 997 |
| |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
634 | 634 |
| |
635 | 635 |
| |
636 | 636 |
| |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
637 | 642 |
| |
638 | 643 |
| |
639 | 644 |
| |
|
@@ -0,0 +1,31 @@
1
+// run
2
+
3
+// Copyright 2014 The Go Authors. All rights reserved.
4
+// Use of this source code is governed by a BSD-style
5
+// license that can be found in the LICENSE file.
6
+
7
+// Issue 8325: corrupted byte operations during optimization
8
+// pass.
9
+
10
+package main
11
+
12
+const alphanum = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
13
+
14
+func main() {
15
+ var bytes = []byte{10, 20, 30, 40, 50}
16
+
17
+ for i, b := range bytes {
18
+ bytes[i] = alphanum[b%byte(len(alphanum))]
19
+ }
20
+
21
+ for _, b := range bytes {
22
+ switch {
23
+ case '0' <= b && b <= '9',
24
+ 'A' <= b && b <= 'Z':
25
+ default:
26
+ println("found a bad character", string(b))
27
+ panic("BUG")
28
+ }
29
+
30
+ }
31
+}
0 commit comments