Patch LGTM; is there a way that we could add a test to ensure
diagnoseOverflow doesn't break again (since this is fixing a
regression)?

~Aaron

On Wed, Jul 24, 2013 at 2:28 PM, Rafael Espíndola
<[email protected]> wrote:
> BalancedDelimiterTracker::diagnoseOverflow calls P.SkipUntil which is
> itself recursive. This can cause a stack overflow on systems that have
> a limited stack. For example, on OS X with a debug build I get:
>
> $ (ulimit -s 1000; ./bin/clang -cc1
> ~/llvm/clang/test/Parser/parser_overflow.c  -DHUGE > /dev/null 2>&1;
> echo $?)
> 139
>
> (ulimit -s 10000; ./bin/clang -cc1
> ~/llvm/clang/test/Parser/parser_overflow.c  -DHUGE > /dev/null 2>&1;
> echo $?)
> 1
>
> The attached patch fixes the problem by just special casing "skip to
> the end of the file" to not try to balance tokens.
>
> I found this while testing pipefail on windows, so it would get an
> automatic test once we switch. check-all is clean, Is the patch ok?
>
> Cheers,
> Rafael

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to