]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc, cmd/6g: fix error on large stacks.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Fri, 18 Jan 2013 21:36:43 +0000 (22:36 +0100)
committerRémy Oudompheng <oudomphe@phare.normalesup.org>
Fri, 18 Jan 2013 21:36:43 +0000 (22:36 +0100)
Fixes #4666.

R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/7141047

src/cmd/6g/cgen.c
src/cmd/gc/go.h
test/fixedbugs/bug385_64.go
test/fixedbugs/issue4348.go

index eff81e2a7eab044d635969d818e950a6bd8e9e73..41694100b563160064c11ba6e9b2429590df33a5 100644 (file)
@@ -1329,7 +1329,7 @@ void
 sgen(Node *n, Node *ns, int64 w)
 {
        Node nodl, nodr, nodsi, noddi, cx, oldcx, tmp;
-       int32 c, q, odst, osrc;
+       vlong c, q, odst, osrc;
 
        if(debug['g']) {
                print("\nsgen w=%lld\n", w);
index adca665ef7da2c32be8ed96ca782ca56b3f2eda3..5e929d3c5bd5eb1581cddffb2d79a495e4b6f466 100644 (file)
@@ -320,7 +320,7 @@ struct      Node
        int32   lineno;
        int32   endlineno;
        vlong   xoffset;
-       int32   stkdelta;       // offset added by stack frame compaction phase.
+       vlong   stkdelta;       // offset added by stack frame compaction phase.
        int32   ostk;
        int32   iota;
        uint32  walkgen;
@@ -912,8 +912,8 @@ EXTERN      int     loophack;
 EXTERN int32   iota;
 EXTERN NodeList*       lastconst;
 EXTERN Node*   lasttype;
-EXTERN int32   maxarg;
-EXTERN int32   stksize;                // stack size for current frame
+EXTERN vlong   maxarg;
+EXTERN vlong   stksize;                // stack size for current frame
 EXTERN int32   blockgen;               // max block number
 EXTERN int32   block;                  // current block number
 EXTERN int     hasdefer;               // flag that curfn has defer statetment
index 8c7b9d52081f237633a7ff77e5649218dc776f1e..f8ccb42a9b60a96f6ff81d2202af0c01c95afe23 100644 (file)
@@ -8,11 +8,17 @@
 // license that can be found in the LICENSE file.
 
 // Issue 2444
+// Issue 4666: issue with arrays of exactly 4GB.
 
 package main
-func main() {  // ERROR "stack frame too large"
+
+func main() { // ERROR "stack frame too large"
        var arr [1000200030]int32
        arr_bkup := arr
        _ = arr_bkup
 }
 
+func F() { // ERROR "stack frame too large"
+       var arr [1 << 30]int32
+       _ = arr[42]
+}
index c86964754c4381e661a6b6c7ef8e1a4e26e5be98..e1d172e9d2fd853251aeaa34a9a77fdae64a145f 100644 (file)
@@ -1,4 +1,7 @@
-// compile
+// skip
+
+// NOTE: this test is now skipped because the relevant code
+// is rejected after fixing issue 4666.
 
 // Copyright 2012 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style