Commit aa8a418b by Ian Lance Taylor

text/template: reduce maxExecDepth for gccgo

    
    When using gccgo on systems without full support for split stacks a
    recursive template can overrun the available stack space.  Reduce the
    limit from 100000 to 10000 to make this less likely.  It's still high
    enough that real uses will work.
    
    Reviewed-on: https://go-review.googlesource.com/25467

From-SVN: r239141
parent 7a62db97
ca5b64137f013e3104fd74ee7d07ba556a501187 235dffb0de1e99d6f521f052067f0e936bf63baa
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -19,7 +19,9 @@ import ( ...@@ -19,7 +19,9 @@ import (
// templates. This limit is only practically reached by accidentally // templates. This limit is only practically reached by accidentally
// recursive template invocations. This limit allows us to return // recursive template invocations. This limit allows us to return
// an error instead of triggering a stack overflow. // an error instead of triggering a stack overflow.
const maxExecDepth = 100000 // For gccgo we make this 10000 rather than 100000 to avoid stack overflow
// on non-split-stack systems.
const maxExecDepth = 10000
// state represents the state of an execution. It's not part of the // state represents the state of an execution. It's not part of the
// template so that multiple executions of the same template // template so that multiple executions of the same template
......
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