flatbuffers
flatbuffers copied to clipboard
[C++] Rare bad buffer content alignment if sizeof(T) != alignof(T)
EDIT: Fix for https://github.com/google/flatbuffers/issues/7516, see below
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
@dbaileychess Could you review this PR please?
I fixed the issue by adding alignment parameters to functions calling StartVector.
Additionally, I spotted several expressions in the codebase of the form array_length = len * sizeof(T) / AlignOf<T>() that do not seem right to me and might need a correction.
@Naios You need to add your new file to the bazel build rule, its failing CI: https://github.com/google/flatbuffers/blob/master/tests/BUILD.bazel#L7
Generally looks good to me.
@dbaileychess Thank you for your review, I have fixed the outstanding changes and optimizations.
@dbaileychess From my side this PR is finished, do you know why workflow "buildkite/flatbuffers/pr" is failing without any useful output?
Build kite error:
:bazel: buildifier: found 1 format issue in your WORKSPACE, BUILD and *.bzl files
Please download [buildifier 5.1.0](https://github.com/bazelbuild/buildtools/releases/tag/5.1.0) and run the following command in your workspace:
buildifier tests/BUILD.bazel
Looks like you placed the deps out of alphanumeric order.
The fuzzer build is failing too, looks like due to stricter warnings on the deprecated method. Can you see if the deprecated method is being used in the fuzzer to fix it?
@dbaileychess I probably have fixed the remaining issues, could you approve the outstanding workflows again please?
Thanks a bunch!