aboutsummaryrefslogtreecommitdiff
path: root/aidl_language_y.yy
diff options
context:
space:
mode:
Diffstat (limited to 'aidl_language_y.yy')
-rw-r--r--aidl_language_y.yy7
1 files changed, 3 insertions, 4 deletions
diff --git a/aidl_language_y.yy b/aidl_language_y.yy
index 95185798..3078dae3 100644
--- a/aidl_language_y.yy
+++ b/aidl_language_y.yy
@@ -772,10 +772,9 @@ parameter_non_empty_list
annotation
: ANNOTATION {
- auto annot = AidlAnnotation::Parse(loc(@1), $1->GetText(), {}, $1->GetComments());
- if (annot) {
- $$ = annot.release();
- } else {
+ // release() returns nullptr if unique_ptr is empty.
+ $$ = AidlAnnotation::Parse(loc(@1), $1->GetText(), {}, $1->GetComments()).release();
+ if (!$$) {
ps->AddError();
}
delete $1;