C++1y: Add a step limit to constexpr evaluation, to catch runaway loops.

llvm-svn: 181388
This commit is contained in:
Richard Smith
2013-05-08 02:12:03 +00:00
parent 1aee70b773
commit a3d3bd215b
7 changed files with 36 additions and 4 deletions

View File

@@ -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,