File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,17 @@ local test_lib = require("lib")
1616
1717local function TestOneInput (buf , _size )
1818 local fdp = luzer .FuzzedDataProvider (buf )
19- local count = fdp :consume_integer (0 , test_lib .MAX_INT )
19+ local count = fdp :consume_integer (1 , test_lib .MAX_INT )
2020 local tbl = fdp :consume_strings (test_lib .MAX_STR_LEN , count )
2121
2222 local indices_count = fdp :consume_integer (0 , # tbl )
23- local indices = fdp :consume_integers (0 , count , indices_count )
23+ local min_index = 0
24+ -- PUC Rio Lua 5.2+ raises an error "position out of bounds"
25+ -- when `pos` is equal to 0 and table is not empty.
26+ if test_lib .lua_current_version_ge_than (5 , 2 ) then
27+ min_index = 1
28+ end
29+ local indices = fdp :consume_integers (min_index , count , indices_count )
2430 for _ , idx in ipairs (indices ) do
2531 local old_v = tbl [idx ]
2632 assert (table.remove (tbl , idx ) == old_v )
You can’t perform that action at this time.
0 commit comments