[PATCH] D39419: Fix crash when parsing objective-c++ containing invalid lambda

Jan Korous via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 3 03:06:30 PDT 2017


jkorous-apple added inline comments.


================
Comment at: lib/Parse/ParseExprCXX.cpp:1020
 
-  PA.Commit();
-  return false;
+  PA2.Revert();
+  return true;
----------------
arphaman wrote:
> 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?
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.


================
Comment at: test/Parser/objcxx11-invalid-lambda.cpp:11
+}               // expected-error{{expected ')'}} expected-error{{expected ';' at end of declaration}} expected-error{{expected '}'}}
\ No newline at end of file

----------------
arphaman wrote:
> Nit: missing newline.
Thanks, will add one.


https://reviews.llvm.org/D39419





More information about the cfe-commits mailing list