libctf: get the encoding of non-ints/fps in the dynamic space right
authorNick Alcock <nick.alcock@oracle.com>
Fri, 9 Aug 2019 21:53:50 +0000 (22:53 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Thu, 3 Oct 2019 16:04:56 +0000 (17:04 +0100)
commit9c1a2295e84170d2de06ef3c828f0c9f5933867e
tree7b12d11479fa4c3c8cbdb79ebc86e476b9eac721
parent1a6ab13e712348c59c2757457b9f913a333f3c92
libctf: get the encoding of non-ints/fps in the dynamic space right

If you call ctf_type_encoding() on a slice, you are meant to get the
encoding of the slice with the format of the underlying type.  If
you call it on a non-int, non-fp, non-slice, you're meant to get the
error ECTF_INTNOTFP.

None of this was implemented for types in the dynamic space (which, now,
is *all* types in writable containers).  Instead, we were always
returning the encoding as if it were a float, which for all other types
consulted the wrong part of a discriminated union and returned garbage.
(Curiously, existing users were more disturbed by the lack of an error
in the non-int/fp/slice case than they were about getting garbage back.)

libctf/
* ctf-types.c (ctf_type_encoding): Fix the dynamic case to
work right for non-int/fps.
libctf/ChangeLog
libctf/ctf-types.c
This page took 0.023615 seconds and 4 git commands to generate.