File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -2013,14 +2013,14 @@ func HeapAllocReason(n ir.Node) string {
2013
2013
return "too large for stack"
2014
2014
}
2015
2015
2016
- if (n .Op () == ir .ONEW || n .Op () == ir .OPTRLIT ) && n .Type ().Elem ().Width >= ir .MaxImplicitStackVarSize {
2016
+ if (n .Op () == ir .ONEW || n .Op () == ir .OPTRLIT ) && n .Type ().Elem ().Width > ir .MaxImplicitStackVarSize {
2017
2017
return "too large for stack"
2018
2018
}
2019
2019
2020
- if n .Op () == ir .OCLOSURE && typecheck .ClosureType (n .(* ir.ClosureExpr )).Size () >= ir .MaxImplicitStackVarSize {
2020
+ if n .Op () == ir .OCLOSURE && typecheck .ClosureType (n .(* ir.ClosureExpr )).Size () > ir .MaxImplicitStackVarSize {
2021
2021
return "too large for stack"
2022
2022
}
2023
- if n .Op () == ir .OCALLPART && typecheck .PartialCallType (n .(* ir.SelectorExpr )).Size () >= ir .MaxImplicitStackVarSize {
2023
+ if n .Op () == ir .OCALLPART && typecheck .PartialCallType (n .(* ir.SelectorExpr )).Size () > ir .MaxImplicitStackVarSize {
2024
2024
return "too large for stack"
2025
2025
}
2026
2026
@@ -2033,7 +2033,7 @@ func HeapAllocReason(n ir.Node) string {
2033
2033
if ! ir .IsSmallIntConst (r ) {
2034
2034
return "non-constant size"
2035
2035
}
2036
- if t := n .Type (); t .Elem ().Width != 0 && ir .Int64Val (r ) >= ir .MaxImplicitStackVarSize / t .Elem ().Width {
2036
+ if t := n .Type (); t .Elem ().Width != 0 && ir .Int64Val (r ) > ir .MaxImplicitStackVarSize / t .Elem ().Width {
2037
2037
return "too large for stack"
2038
2038
}
2039
2039
}
Original file line number Diff line number Diff line change @@ -489,7 +489,7 @@ func walkNew(n *ir.UnaryExpr, init *ir.Nodes) ir.Node {
489
489
base .Errorf ("%v can't be allocated in Go; it is incomplete (or unallocatable)" , n .Type ().Elem ())
490
490
}
491
491
if n .Esc () == ir .EscNone {
492
- if t .Size () >= ir .MaxImplicitStackVarSize {
492
+ if t .Size () > ir .MaxImplicitStackVarSize {
493
493
base .Fatalf ("large ONEW with EscNone: %v" , n )
494
494
}
495
495
return stackTempAddr (init , t )
You can’t perform that action at this time.
0 commit comments