Skip to content

Commit 97db1e2

Browse files
committed
delete std::variants when we're done with them
1 parent 966b855 commit 97db1e2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libexpr/parser.y

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ expr_simple
311311
[&](std::string_view str) { $$ = new ExprString(state->alloc, str); },
312312
[&](Expr * expr) { $$ = expr; }},
313313
*$2);
314+
delete $2;
314315
}
315316
| IND_STRING_OPEN ind_string_parts IND_STRING_CLOSE {
316317
$$ = state->stripIndentation(CUR_POS, std::move(*$2));
@@ -471,6 +472,7 @@ attrs
471472
});
472473
}
473474
}, *$2);
475+
delete $2;
474476
}
475477
| { $$ = new std::vector<std::pair<AttrName, PosIdx>>; }
476478
;
@@ -483,6 +485,7 @@ attrpath
483485
[&](std::string_view str) { $$->push_back(AttrName(state->symbols.create(str))); },
484486
[&](Expr * expr) { $$->push_back(AttrName(expr)); }
485487
}, *$3);
488+
delete $3;
486489
}
487490
| attr { $$ = new std::vector<AttrName>; $$->push_back(AttrName(state->symbols.create($1))); }
488491
| string_attr
@@ -491,6 +494,7 @@ attrpath
491494
[&](std::string_view str) { $$->push_back(AttrName(state->symbols.create(str))); },
492495
[&](Expr * expr) { $$->push_back(AttrName(expr)); }
493496
}, *$1);
497+
delete $1;
494498
}
495499
;
496500

0 commit comments

Comments
 (0)