[PATCH] Don't crash on reporting lambda diagnostics
richard at metafoo.co.uk
Wed Apr 29 10:36:28 PDT 2015
Is the real problem that we're entering the lambda scope too early? The
scope shoudn't start until we get to the body -- things referenced from
within the parameter-declaration-clause of the inner lambda should not be
captured by it, so the LSI->Lambda pointer for the inner lambda should
never be referenced until we're ready to capture.
On Wed, Apr 29, 2015 at 10:09 AM, Aaron Ballman <aaron at aaronballman.com>
> On Thu, Apr 23, 2015 at 11:31 AM, Aaron Ballman <aaron at aaronballman.com>
> > Ping
> > On Fri, Apr 10, 2015 at 10:08 AM, Aaron Ballman <aaron at aaronballman.com>
> >> PR23021 demonstrates a case where diagnostic reporting on an inner
> >> lambda would crash due to a null pointer dereference. Since captures
> >> happen from calling ParseParameterDeclarationClause, which is before
> >> the semantic lambda object is created, another mechanism is required
> >> to get the lambda introducer location.
> >> This patch addresses it by storing the introducer location into the
> >> scope object directly, and using that location when reporting the
> >> diagnostics. The result is the same, but no longer relies on a lambda
> >> object being created first.
> >> ~Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits