This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No.
31".
I assume that the CtorDtorsByPriority map is always meant to be cleared,
on success or failure.
Differential D62120
[ORC] fix unreachable code bug nickdesaulniers on May 19 2019, 10:26 PM. Authored by
Details
This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No. I assume that the CtorDtorsByPriority map is always meant to be cleared,
Diff Detail
Event TimelineComment Actions We don't want to clear unconditionally: we should (at least optionally) preserve the state so that clients can attempt recovery from transient errors (e.g. network drop-outs). That said, I think the behavior you have proposed is reasonable. We could make it the default by adding an argument to the run method: Error run(bool ClearCtorDtorsOnFailure = true); Or we should add a clear() method to the CtorDtorRunner interface and document that clients need to clear the list manually on failure. I think the first option is probably less error-prone. Comment Actions Wouldn't just deleting L142 from the existing sources be simpler? (or moving L146-148 into the for loop at the end (L142)? Comment Actions Moving 146/148 into the loop gets you "map cleared on success but not on error" behavior, which is what I had intended. I have made that change in r361199, so I will close this out. My thoughts above were on how to get "Optionally cleared on error" behavior, which I think is useful. Implementing that can wait for another day though. |