Skip to content

Update lite_unittest to pad varints before calling internal::VarintParse()#15151

Merged
1 commit merged into
mainfrom
test_592344313
Dec 19, 2023
Merged

Update lite_unittest to pad varints before calling internal::VarintParse()#15151
1 commit merged into
mainfrom
test_592344313

Conversation

@copybara-service

Copy link
Copy Markdown

Update lite_unittest to pad varints before calling internal::VarintParse()

The VarintParse() function is ordinarily called only by the proto parser,
which always provides 16 bytes of "slop" space at the end of the buffer. The
ARM-specific optimized path takes advantage of this by always reading at least
8 bytes. However, this caused some test failures in msan due to unit tests not
providing a sufficient amount of initialized padding. This CL fixes the problem
by making sure the unit tests initialize the full 10-byte buffer and adding a
comment stating that this is a precondition of the function.

…arse()`

The `VarintParse()` function is ordinarily called only by the proto parser,
which always provides 16 bytes of "slop" space at the end of the buffer. The
ARM-specific optimized path takes advantage of this by always reading at least
8 bytes. However, this caused some test failures in msan due to unit tests not
providing a sufficient amount of initialized padding. This CL fixes the problem
by making sure the unit tests initialize the full 10-byte buffer and adding a
comment stating that this is a precondition of the function.

PiperOrigin-RevId: 592366291
@copybara-service copybara-service Bot closed this pull request by merging all changes into main in bc66a18 Dec 19, 2023
@copybara-service copybara-service Bot deleted the test_592344313 branch December 19, 2023 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants