Skip to content

Commit

Permalink
IOBufTest.cpp: fix a test for llvm15
Browse files Browse the repository at this point in the history
Summary:
Avoid this: (full log P847931899):
  $ buck2 test -c fbcode.platform010_clang=15 folly/io/test:iobuf_test -- --exact 'folly/io/test:iobuf_test - IOBuf.computeChainCapacityOfZeroSizeIOBuf'
  ...
    fbcode/folly/io/test/IOBufTest.cpp:1762:16: runtime error: variable length array bound evaluates to non-positive value 0

Reviewed By: bcardosolopes, luciang

Differential Revision: D50027080

fbshipit-source-id: 66d0a4975b5484b72920887fefac1bcd6b84b4b7
  • Loading branch information
Jim Meyering authored and facebook-github-bot committed Oct 8, 2023
1 parent f230af0 commit 34f110b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion folly/io/test/IOBufTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1759,7 +1759,7 @@ TEST(IOBuf, FreeFn) {
// Compute the chained capacity of a single non-chained IOBuf of capacity zero
TEST(IOBuf, computeChainCapacityOfZeroSizeIOBuf) {
size_t size = 0;
uint8_t data[size];
uint8_t* data = nullptr;

// Create buffer of capacity 0
unique_ptr<IOBuf> buf(IOBuf::wrapBuffer(data, size));
Expand Down

0 comments on commit 34f110b

Please sign in to comment.