jonreid/OCMockito — pull request #32 by chrisdevereux (2013-06-18 00:53:13+00:00)
Title: Crash when passing stack block arguments to methods of mock objects

When normal (non-matcher) objects are passed as arguments to a mock, they are wrapped in a matcher and retained by the mock.

This causes some trouble with stack blocks, as the matcher may outlast the block's stack frame. When it is deallocated, it releases the block. Hilarity ensues.

NSObject has a private isBlock method, which could be used to decide whether or not to copy the argument when wrapping it up. I'd be happy to add this check if you're ok with the private API usage.