)]}'
{
  "commit": "ffeece6ac2d4e4d2bf28c910b51c74ffc881c963",
  "tree": "dbb61a523d3289f68a024ed1c84a4290d75b364b",
  "parents": [
    "91e7ce2fd7b82f3982b453d1c6f4576621bc1c2d"
  ],
  "author": {
    "name": "Nick Alcock",
    "email": "nick.alcock@oracle.com",
    "time": "Tue Jan 05 13:25:56 2021 +0000"
  },
  "committer": {
    "name": "Nick Alcock",
    "email": "nick.alcock@oracle.com",
    "time": "Tue Jan 05 14:53:39 2021 +0000"
  },
  "message": "libctf, ld: prohibit getting the size or alignment of forwards\n\nC allows you to do only a very few things with entities of incomplete\ntype (as opposed to pointers to them): make pointers to them and give\nthem cv-quals, roughly. In particular you can\u0027t sizeof them and you\ncan\u0027t get their alignment.\n\nWe cannot impose all the requirements the standard imposes on CTF users,\nbecause the deduplicator can transform any structure type into a forward\nfor the purposes of breaking cycles: so CTF type graphs can easily\ncontain things like arrays of forward type (if you want to figure out\ntheir size or alignment, you need to chase down the types this forward\nmight be a forward to in child TU dicts: we will soon add API functions\nto make doing this much easier).\n\nNonetheless, it is still meaningless to ask for the size or alignment of\nforwards: but libctf didn\u0027t prohibit this and returned nonsense from\ninternal implementation details when you asked (it returned the kind of\nthe pointed-to type as both the size and alignment, because forwards\nreuse ctt_type as a type kind, and ctt_type and ctt_size overlap).  So\nintroduce a new error, ECTF_INCOMPLETE, which is returned when you try\nto get the size or alignment of forwards: we also return it when you try\nto do things that require libctf itself to get the size or alignment of\na forward, notably using a forward as an array index type (which C\nshould never do in any case) or adding forwards to structures without\nspecifying their offset explicitly.\n\nThe dumper will not emit size or alignment info for forwards any more.\n\n(This should not be an API break since ctf_type_size and ctf_type_align\ncould both return errors before now: any code that isn\u0027t expecting error\nreturns is already potentially broken.)\n\ninclude/ChangeLog\n2021-01-05  Nick Alcock  \u003cnick.alcock@oracle.com\u003e\n\n\t* ctf-api.h (ECTF_INCOMPLETE): New.\n\t(ECTF_NERR): Adjust.\n\nld/ChangeLog\n2021-01-05  Nick Alcock  \u003cnick.alcock@oracle.com\u003e\n\n\t* testsuite/ld-ctf/conflicting-cycle-1.parent.d: Adjust for dumper\n\tchanges.\n\t* testsuite/ld-ctf/cross-tu-cyclic-conflicting.d: Likewise.\n\t* testsuite/ld-ctf/forward.c: New test...\n\t* testsuite/ld-ctf/forward.d: ... and results.\n\nlibctf/ChangeLog\n2021-01-05  Nick Alcock  \u003cnick.alcock@oracle.com\u003e\n\n\t* ctf-types.c (ctf_type_resolve): Improve comment.\n\t(ctf_type_size): Yield ECTF_INCOMPLETE when applied to forwards.\n\tEmit errors into the right dict.\n\t(ctf_type_align): Likewise.\n\t* ctf-create.c (ctf_add_member_offset): Yield ECTF_INCOMPLETE\n\twhen adding a member without explicit offset when this member, or\n\tthe previous member, is incomplete.\n\t* ctf-dump.c (ctf_dump_format_type): Do not try to print the size of\n\tforwards.\n\t(ctf_dump_member): Do not try to print their alignment.\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "048ba6113f95d63c315a3e2197fd1e3c5d275bce",
      "old_mode": 33188,
      "old_path": "include/ChangeLog",
      "new_id": "1b56987ea9b57735aa40d01913c6266b48f66b0c",
      "new_mode": 33188,
      "new_path": "include/ChangeLog"
    },
    {
      "type": "modify",
      "old_id": "f221d17f33e6b003a56abbba3a5efd5eed31b639",
      "old_mode": 33188,
      "old_path": "include/ctf-api.h",
      "new_id": "b3cfd391506badcfb5460eb0b58b6637cc6037db",
      "new_mode": 33188,
      "new_path": "include/ctf-api.h"
    },
    {
      "type": "modify",
      "old_id": "a130c6c06d26cfc36159c06e79d19a982f3cb6ca",
      "old_mode": 33188,
      "old_path": "ld/ChangeLog",
      "new_id": "1497fc40e702a9acbfc93b19e90c148130a1d718",
      "new_mode": 33188,
      "new_path": "ld/ChangeLog"
    },
    {
      "type": "modify",
      "old_id": "4cbe9b61f3c26f9809640eed7699a586e34b8b52",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-ctf/conflicting-cycle-1.parent.d",
      "new_id": "5da66fda14c99371b59720ee68c1c7ef785776c8",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-ctf/conflicting-cycle-1.parent.d"
    },
    {
      "type": "modify",
      "old_id": "3c975ebaa510824538eda4880360db2f72bab713",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-ctf/cross-tu-cyclic-conflicting.d",
      "new_id": "eff295edd308612f010aac9e478da1d740879d57",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-ctf/cross-tu-cyclic-conflicting.d"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e41a7aececaf8dd6401e53303a13def3fad3c75d",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-ctf/forward.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "9ff0dd2ba73e7e72b518cbbe83d52058671e25d1",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-ctf/forward.d"
    },
    {
      "type": "modify",
      "old_id": "80f05e90ff6920e6c98068dcfc12e7e7243488de",
      "old_mode": 33188,
      "old_path": "libctf/ChangeLog",
      "new_id": "b9142541063d4a617128bde7a441fd3540f0de90",
      "new_mode": 33188,
      "new_path": "libctf/ChangeLog"
    },
    {
      "type": "modify",
      "old_id": "0af46d3c28a81091e2493643157789611f5bb0ca",
      "old_mode": 33188,
      "old_path": "libctf/ctf-create.c",
      "new_id": "6fe7461c527854d97db0f6cb1ccc8c0f1946813a",
      "new_mode": 33188,
      "new_path": "libctf/ctf-create.c"
    },
    {
      "type": "modify",
      "old_id": "f01f225d4326e4100e93e1c1b07117e453dbd3fa",
      "old_mode": 33188,
      "old_path": "libctf/ctf-dump.c",
      "new_id": "abed48310f6c70c2a7ac28853655e92fa698198a",
      "new_mode": 33188,
      "new_path": "libctf/ctf-dump.c"
    },
    {
      "type": "modify",
      "old_id": "61891d67ba2de9856018befd96be3052b016b6ba",
      "old_mode": 33188,
      "old_path": "libctf/ctf-types.c",
      "new_id": "3ba635f48bbf961e8e3d3983d499f43ecd8c16dc",
      "new_mode": 33188,
      "new_path": "libctf/ctf-types.c"
    }
  ]
}
