Changes between Version 2 and Version 3 of Ticket #107


Ignore:
Timestamp:
Jan 16, 2019, 3:23:05 PM (7 years ago)
Author:
Thierry Delisle
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #107

    • Property Summary task/waitfor tuple problemtuple depth problem
  • Ticket #107 – Description

    v2 v3  
    1 EDIT: new smaller repro code is :
    2 {{{
    3 #include <monitor.hfa>
     1Changed this ticket completely as it has nothing to do with monitors, threads or waitfor statements:
    42
    5 monitor Gortn {};
    6 [void] mem3( Gortn & mutex gortn, [int, int] m ) {}
     3The following code : {{{
     4typedef void (*fptr_t)();
     5typedef * [void] ( [int, int] m ) foo_t;
     6
     7struct Test{};
     8void ?{}(Test & this, int, fptr_t func);
     9
     10[void] foo([int, int] m ) {
     11        Test test = {2, (fptr_t)(foo_t) foo};
     12}
    713}}}
    814
    9 OLD:
    10 It has something to do with the tuple.
    11 {{{
    12 #include <thread.hfa>
     15produces : {{{
     16bug107-2.cfa:17:1 error: Managed object's initializer is too deep test: instance of struct Test with body 1 with initializer (maybe constructed)
     17  Compound initializer:
     18    Simple Initializer: constant expression (2 2: signed int)
     19    Simple Initializer: Cast of:
     20      Cast of:
     21        Name: foo
     22      ... to:
     23        pointer to function
     24        ... with parameters
     25          m: tuple of types
     26            signed int
     27            signed int
    1328
    14 thread Gortn {};
    15 [void] mem3( Gortn & mutex gortn, [int, int] m ) {}
    16 
    17 void main( Gortn & gortn ) {
    18         waitfor( mem3, gortn );
    19 }
    20 }}}
    21 {{{
    22 cfa test1.c
    23 CFA Version 1.0.0 (debug)
    24 error: Managed object's initializer is too deep __guard: instance of struct monitor_guard_t with body 1  with initializer (maybe constructed)
    25   Compound initializer:
    26     Simple Initializer: Variable Expression: __monitors: array of pointer to instance of struct monitor_desc with body 1  with dimension of constant expression (1 1: unsigned long int)
    27     ... with environment:
    28       Types:
    29       Non-types:
    30 
    31     Simple Initializer: constant expression (1 1: unsigned long int)
    32     Simple Initializer: Cast of:
    33       Variable Expression: mem3: function
    34       ... with parameters
    35         gortn: mutex reference to instance of struct Gortn with body 1
    36         m: tuple of types
    37           signed int
    38           signed int
    39 
    40       ... returning nothing
     29        ... returning nothing
    4130
    4231    ... to:
    43       function
     32      pointer to function
    4433        accepting unspecified arguments
    45       ... returning nothing
     34      ... returning nothing
     35
    4636}}}