summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-05-08 02:12:03 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-05-08 02:12:03 +0000
commite7565635002ce0daaaf4b714cdb472507af462ee (patch)
tree966fe6ecb16cd262ede8e9a89292040cd62d1064 /lib/Frontend/CompilerInvocation.cpp
parentaecda966174516c0ac7c05ceb40e88fc99bcf27c (diff)
downloadclang-e7565635002ce0daaaf4b714cdb472507af462ee.tar.gz
clang-e7565635002ce0daaaf4b714cdb472507af462ee.tar.bz2
clang-e7565635002ce0daaaf4b714cdb472507af462ee.tar.xz
C++1y: Add a step limit to constexpr evaluation, to catch runaway loops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181388 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--lib/Frontend/CompilerInvocation.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 42ea96f0f2..9c8eea10ad 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -1251,6 +1251,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
Diags);
Opts.ConstexprCallDepth = Args.getLastArgIntValue(OPT_fconstexpr_depth, 512,
Diags);
+ Opts.ConstexprStepLimit = Args.getLastArgIntValue(OPT_fconstexpr_steps,
+ 1048576, Diags);
Opts.BracketDepth = Args.getLastArgIntValue(OPT_fbracket_depth, 256, Diags);
Opts.DelayedTemplateParsing = Args.hasArg(OPT_fdelayed_template_parsing);
Opts.NumLargeByValueCopy = Args.getLastArgIntValue(OPT_Wlarge_by_value_copy_EQ,