flatbuffers
flatbuffers copied to clipboard
code generation of convenient C++ "CreateXXX" member functions is broken!
For example, currently it generates this wrong code:
return CreateStat(_fbb, mac ? 0 : _fbb.CreateVector<uint8_t>(*mac), ntx, nrx, nerr);
Instead, it should generate this code:
return CreateStat(_fbb, mac ?_fbb.CreateVector<uint8_t>(*mac): 0, ntx, nrx, nerr);
The bug starts at line 929 and 932 in flatbuffers/src/idl_gen_cpp.cpp.
Thanks for reporting! That apparently was never tested.. I made a quick fix here: https://github.com/google/flatbuffers/commit/3eebba789f6447b342a308b0ad38ed0a6fb51de4