Skip to content

Commit

Permalink
[FIRRTL] Intrinsics: Fix lifetime issues in lambda. (#6534)
Browse files Browse the repository at this point in the history
Fixes #6533.
  • Loading branch information
dtzSiFive authored Dec 20, 2023
1 parent c3ca208 commit 6e50da9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/circt/Dialect/FIRRTL/FIRRTLIntrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,11 @@ class IntrinsicLowerings {
template <typename T>
void addConverter(DenseMap<StringAttr, ConverterFn> &map, StringRef name) {
auto nameAttr = StringAttr::get(context, name);
map.try_emplace(nameAttr, [&](FModuleLike mod) -> LogicalResult {
T conv(name, mod);
return doLowering(mod, conv);
});
map.try_emplace(nameAttr,
[this, nameAttr](FModuleLike mod) -> LogicalResult {
T conv(nameAttr.getValue(), mod);
return doLowering(mod, conv);
});
}

LogicalResult doLowering(FModuleLike mod, IntrinsicConverter &conv);
Expand Down

0 comments on commit 6e50da9

Please sign in to comment.