poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug default/26527] pinned struct is not working as expected


From: jose.marchesi at oracle dot com
Subject: [Bug default/26527] pinned struct is not working as expected
Date: Tue, 25 Aug 2020 09:19:51 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=26527

Jose E. Marchesi <jose.marchesi at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-08-25
             Status|UNCONFIRMED                 |NEW
                 CC|                            |jose.marchesi at oracle dot com

--- Comment #1 from Jose E. Marchesi <jose.marchesi at oracle dot com> ---
Hi Mohammad.  Thanks for the report.

pinned structs are indeed supported in struct _mappers_.  However, as you can
see constructing pinned structs is a different matter.  The property of being
"pinned" basically means that the offsets of the different fields in the struct
are the same.  However, when constructing the values of the fields are taken
from the fields provided in the initializer.  So this is a rather fundamental
problem, and fixing it would require to re-think the way struct constructors
work.

At this point I would suggest to forbid field initialization when constructing
pinned structs, at compile-time, i.e.

    P { }  -> This works, with i=0x0U,b=[0x0UB,0x0UB,0x0UB,0x0UB]]
    P { i = 0xf00 } -> Compilation error, since P is a pinned struct.

WDYT?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]