diff options
Diffstat (limited to 'libbuild2/script/run.cxx')
-rw-r--r-- | libbuild2/script/run.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libbuild2/script/run.cxx b/libbuild2/script/run.cxx index 7f8fa2f..f122ae5 100644 --- a/libbuild2/script/run.cxx +++ b/libbuild2/script/run.cxx @@ -726,7 +726,14 @@ namespace build2 // to match long strings which they "signal" by running out of // stack or otherwise crashing instead of throwing an exception. // So we impose some sensible limit that all of them are able to - // handle for basic expressions (e.g., [ab]+). + // handle for basic expressions (e.g., [ab]+; GCC's limits are the + // lowest, see bug 86164). See also another check (for the lines + // number) below. + // + // BTW, if we ever need to overcome this limitation (along with + // various hacks for the two-dimensional regex support), one way + // would be to factor libc++'s implementation (which doesn't seem + // to have any stack-related limits) and use it everywhere. // if (s.size () > 16384) { @@ -743,6 +750,13 @@ namespace build2 fail (ll) << "unable to read " << op << ": " << e; } + if (ls.size () > 12288) + { + diag_record d (fail (ll)); + d << pr << " " << what << " has too many lines to match with regex"; + output_info (d, op); + } + // Match the output with the regex. // // Note that we don't distinguish between the line_regex and |