Go to file
Alex Zinenko 3b7b0040ce FunctionParser::~FunctionParser: avoid iterator invalidation
When destroying a FunctionParser in case of parsing failure, we clean up all
uses of undefined forward-declared references.  This has been implemented as
iteration over the list of uses.  However, deleting one use from the list
invalidates the iterator (`IROperand::drop` sets `nextUse` to `nullptr` while
the iterator reads `nextUse` to advance; therefore only the first use was
deleted from the list).  Get a new iterator before calling drop to avoid
invalidation.

PiperOrigin-RevId: 228168849
2019-03-29 15:00:10 -07:00
mlir FunctionParser::~FunctionParser: avoid iterator invalidation 2019-03-29 15:00:10 -07:00