stormalf / chibicc

A small C compiler from rui314
MIT License
6 stars 1 forks source link

ISS-158 during neovim compilation failure with not a struct nor a union #51

Closed stormalf closed 4 months ago

stormalf commented 1 year ago

during neovim compilation failure with not a struct nor a union .../neovim/src/mpack/lmpack.c:325: memcpy(unpacker->string_buffer + MPACK_PARENT_NODE(node)->pos,

^ parse.c: in struct_ref : not a struct nor a union

It happens when we have a macro with one of the return value in a condition is NULL like :

define MPACK_PARENT_NODE(n) (((n) - 1)->pos == (size_t)-1 ? NULL : (n) - 1)

in this case it takes the first type as the expected type instead of returning the second type.

stormalf commented 4 months ago

fixed by pull request 1.0.22 #65