This is an archive of the discontinued LLVM Phabricator instance.

Fix crash when parsing objective-c++ containing invalid lambda
ClosedPublic

Authored by jkorous-apple on Oct 30 2017, 6:59 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

jkorous-apple created this revision.Oct 30 2017, 6:59 AM
arphaman added inline comments.
lib/Parse/ParseExprCXX.cpp
1020 ↗(On Diff #120813)

Just to clarify: It seems like this revert (in addition to two TPAs) is the main addition. Did we hit the assertion previously with the crash?

test/Parser/objcxx11-invalid-lambda.cpp
11 ↗(On Diff #120813)

Nit: missing newline.

jkorous-apple added inline comments.Nov 3 2017, 3:06 AM
lib/Parse/ParseExprCXX.cpp
1020 ↗(On Diff #120813)

Yes, the crash was done by this assert.
Two TPAs are needed because once TPA is reverted it is not active anymore and cannot be committed. As far as I understand it the assert is not necessary since we are parsing just tentatively and using return value for error signaling.

test/Parser/objcxx11-invalid-lambda.cpp
11 ↗(On Diff #120813)

Thanks, will add one.

newline at the end of test file

arphaman accepted this revision.Nov 3 2017, 9:52 AM

lgtm

This revision is now accepted and ready to land.Nov 3 2017, 9:52 AM
This revision was automatically updated to reflect the committed changes.