[fpc-devel] c-blocks (darwin aarch64)

Dmitry Boyarintsev skalogryz.lists at gmail.com
Sun Apr 17 01:23:45 CEST 2016


On Sat, Apr 16, 2016 at 5:42 PM, Jonas Maebe <jonas.maebe at elis.ugent.be>
wrote:

>
> Yes, a test program that can be used to reproduce the bug (preferably
> command line)
>
> even better! it's pure OSX (x86_64)! not need for iOS
http://bugs.freepascal.org/view.php?id=30022

The sample is using block-based APIs of NSFileHandle
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSFileHandle_Class/

to be honest. I've no idea how the method should work, but I'd expect it
shouldn't throw an access violation.

It feels like the problem arrises when the run time tries to copy the
block. The sample with NSArrays traversing doesn't try to retain the block,
instead it just calls it right away.

Yes, that's what optional field means (as opposed to field that is
> optionally initialised or so). You can check the clang source code too:
> http://llvm.org/svn/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp
>
Got it!

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20160416/e79036ce/attachment.html>


More information about the fpc-devel mailing list