Skip to content

Conversation

@dmaclach
Copy link
Contributor

Reallocate class and partial mocks based on the size of the object they are mocking.
For class mocks allow direct referencing of instance variables.
For Partial mocks fills the space with 0xEC and will throw an exception if we detect that an instance variable has been written to. The value 0xEB will intentionally likely cause crashes if the memory is read.

Potential "fix" fox #440

@dmaclach dmaclach force-pushed the class_fix branch 5 times, most recently from c7b3b28 to a4d7168 Compare July 14, 2020 21:51
@dmaclach
Copy link
Contributor Author

Out of all of my outstanding PRs, this is probably the one that will be the hardest to maintain and is also likely the one that will fix the most weird memory corruption issues that people can run into using OCMock.

@dmaclach
Copy link
Contributor Author

dmaclach commented Aug 3, 2020

This is not a feature, but fixes potential crashing bugs, so would be a good candidate for pulling into master ASAP.

@dmaclach
Copy link
Contributor Author

Erik, are you waiting on me for anything here? This one is painful to maintain.

erikdoe and others added 5 commits February 15, 2021 10:40
This should help with spurious build failures on Travis.
Reallocate class and partial mocks based on the size of the object they are mocking.
For class mocks allow direct referencing of instance variables.
For Partial mocks fills the space with 0xEC and will throw an exception if we detect that an instance variable has been written to. The value 0xEB will intentionally likely cause crashes if the memory is read.
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