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

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Apr 16 23:42:10 CEST 2016


> On 16 Apr 2016, at 21:35, Dmitry Boyarintsev <skalogryz.lists at gmail.com> wrote:
> 
> On Sat, Apr 16, 2016 at 3:05 PM, Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:
>>> Using r33526, the app crashes with compiler native blocks at the same
>>> spot (on calling set block handler)
>> 
>> Can you share code that crashes?
> 
> uses
>   .. GameController // from iOS headers
[snip]
>  
> ... or are you looking for the whole project?  

Yes, a test program that can be used to reproduce the bug (preferably command line)

>> See http://clang.llvm.org/docs/Block-ABI-Apple.html#high-level
>> 
>> Those fields only exist if bits 25 resp. 26 are set in the flags.
> 
> There's no real indication that these fields could physically omit. (unless "IFF" or "optional helper fields" in comments actually mean that). 

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

/// buildBlockDescriptor - Build the block descriptor meta-data for a block.
/// buildBlockDescriptor is accessed from 5th field of the Block_literal
/// meta-data and contains stationary information about the block literal.
/// Its definition will have 4 (or optinally 6) words.
/// \code
/// struct Block_descriptor {
///   unsigned long reserved;
///   unsigned long size;  // size of Block_literal metadata in bytes.
///   void *copy_func_helper_decl;  // optional copy helper.
///   void *destroy_func_decl; // optioanl destructor helper.
///   void *block_method_encoding_address; // @encode for block literal signature.
///   void *block_layout_info; // encoding of captured block variables.
/// };

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


More information about the fpc-devel mailing list