Skip to content

Conversation

@oldnewthing
Copy link
Member

ReplaceAll did not provide the strong exception guarantee: If not all the elements could be converted to T, the code left the vector in a partially-replaced state. Now it leaves the vector unchanged if the operation fails. (Note that vector_base::assign does not provide the strong exception guarantee if wrapping is required, so we can't quite declare victory yet.)

If the underlying vector is a vector of value types, then attempting to insert nullptr now fails with E_NOINTERFACE rather than crashing.

If the object's runtime type is not T, then IndexOf should report "not found" rather than reporting the index of the first nullptr (if T is a reference type) or crashing (if T is a value type). This fixes issue #518.

Fixed use-after-free bug in test, where we forgot to unregister event handlers, leaving them with references to destroyed local variables.

* ReplaceAll did not provide the strong exception guarantee:
  If not all the elements could be converted to T,
  the code left the vector in a partially-replaced state.
  Now it leaves the vector unchanged if the operation fails.
  (Note that vector_base::assign does not provide the strong
  exception guarantee if wrapping is required, so we can't
  quite declare victory yet.)

* If the underlying vector is a vector of value types,
  then attempting to insert nullptr now fails with E_NOINTERFACE
  rather than crashing.

* If the object's runtime type is not T, then IndexOf should report
  "not found" rather than reporting the index of the first nullptr
  (if T is a reference type) or crashing (if T is a value type).
Throws an exception rather than crashing.
@kennykerr
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

Copy link
Collaborator

@kennykerr kennykerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants