This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Fix leak in case of failed parse of Block
ClosedPublic

Authored by jpienaar on Mar 20 2022, 8:45 PM.

Details

Summary

A Block is optionally allocated and can leak in failed parse. Change Block
parsing to ensure Block gets freed unless parse is successful. defineBlockNamed
had only 1 call site, inline and track whether allocation was performed.

Diff Detail

Event Timeline

jpienaar created this revision.Mar 20 2022, 8:45 PM
Herald added a project: Restricted Project. · View Herald Transcript
jpienaar requested review of this revision.Mar 20 2022, 8:45 PM
rriddle accepted this revision.Mar 28 2022, 10:14 AM
rriddle added inline comments.
mlir/lib/Parser/Parser.cpp
1956

Can you add a comment for this?

This revision is now accepted and ready to land.Mar 28 2022, 10:14 AM
This revision was automatically updated to reflect the committed changes.
jpienaar marked an inline comment as done.