summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/99_bugs/38_index_segfault
blob: e29b99f79211e0c66f433f6e1d23b46b079d3275 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
When index() or rindex() was invoked with a string haystack and a non-
string needle argument, a segmentation fault occurred due to an internal
strlen() invocation on a NULL pointer.

-- Testcase --
print(index("abc", []), "\n")
-- End --

-- Args --
-R
-- End --

-- Expect stdout --
-1
-- End --


-- Testcase --
print(rindex("abc", []), "\n")
-- End --

-- Args --
-R
-- End --

-- Expect stdout --
-1
-- End --