Commit d127ed53 authored by Rémy Oudompheng's avatar Rémy Oudompheng

cmd/gc, cmd/6g: fix error on large stacks.

Fixes #4666.

R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/7141047
parent 41ec481a
......@@ -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);
......
......@@ -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
......
......@@ -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"
var arr [1000200030]int32
arr_bkup := arr
_ = arr_bkup
}
func F() { // ERROR "stack frame too large"
var arr [1 << 30]int32
_ = arr[42]
}
// 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment