]> granicus.if.org Git - clang/commitdiff
Reduce default template instantiation depth to 512; we're blowing out
authorDouglas Gregor <dgregor@apple.com>
Mon, 2 Jul 2012 19:56:23 +0000 (19:56 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 2 Jul 2012 19:56:23 +0000 (19:56 +0000)
the stack too often with 1024. Fixes <rdar://problem/11678534>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159573 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/LangOptions.def
lib/Frontend/CompilerInvocation.cpp

index b525e43e06abb9722837abc594363e78574a47b5..381b1ba2f0b36fc9f3002b976e75cd434504cb79 100644 (file)
@@ -149,7 +149,7 @@ ENUM_LANGOPT(StackProtector, StackProtectorMode, 2, SSPOff,
 ENUM_LANGOPT(SignedOverflowBehavior, SignedOverflowBehaviorTy, 2, SOB_Undefined,
              "signed integer overflow handling")
 
-BENIGN_LANGOPT(InstantiationDepth, 32, 1024
+BENIGN_LANGOPT(InstantiationDepth, 32, 512
                "maximum template instantiation depth")
 BENIGN_LANGOPT(ConstexprCallDepth, 32, 512,
                "maximum constexpr call depth")
index 391c2d27a80a3f5bb64f6d73c8b2b958ceb7336c..943cb20e2dd986eaf2ff706d00f4f198ec80043b 100644 (file)
@@ -2026,7 +2026,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
   Opts.AccessControl = !Args.hasArg(OPT_fno_access_control);
   Opts.ElideConstructors = !Args.hasArg(OPT_fno_elide_constructors);
   Opts.MathErrno = Args.hasArg(OPT_fmath_errno);
-  Opts.InstantiationDepth = Args.getLastArgIntValue(OPT_ftemplate_depth, 1024,
+  Opts.InstantiationDepth = Args.getLastArgIntValue(OPT_ftemplate_depth, 512,
                                                     Diags);
   Opts.ConstexprCallDepth = Args.getLastArgIntValue(OPT_fconstexpr_depth, 512,
                                                     Diags);