Closed andylokandy closed 4 years ago
It looks like the substring primitive doesn't check bounds properly, resulting in a dodgy string. Chez throws an exception in this case, and C crashes. The primitive should probably return an empty string in these cases rather than crash.
Steps to Reproduce
Expected Behavior
Output
""
Observed Behavior
If I eval
thisGoesWrong
in repl, the compiler will throwsegment fault
; if I executemain
, the compiler throwsException in substring: 1 and 0 are not valid start/end indices for ""
.Both
(join "a" [])
and"" ++ ""
are fine, but it breaks when they come together.