allow setting template/macro recursive evaluation limits (#7652)
* allow setting template/macro recursive evaluation limits * revert setting template/macro eval limits set them to 1000
This commit is contained in:
parent
3402926372
commit
7e15d5134b
7 changed files with 14 additions and 10 deletions
|
|
@ -44,7 +44,7 @@ proc applyPatterns(c: PContext, n: PNode): PNode =
|
|||
assert x.kind in {nkStmtList, nkCall}
|
||||
# better be safe than sorry, so check evalTemplateCounter too:
|
||||
inc(evalTemplateCounter)
|
||||
if evalTemplateCounter > 100:
|
||||
if evalTemplateCounter > evalTemplateLimit:
|
||||
globalError(n.info, errTemplateInstantiationTooNested)
|
||||
# deactivate this pattern:
|
||||
c.patterns[i] = nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue