You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
0.10.0-7c7e036 [release]
compiled with: llvm 3.8.1 -- Apple LLVM version 7.3.0 (clang-703.0.29)
Issue
Observed Behavior
Using a string that is created using String.from_array where the array is empty results in a segmentation fault.
Expected Behavior
A string that is created using String.from_array should behave like a zero-length string.
Steps to Reproduce
This program reproduces the issue:
actorMainnewcreate(env: Env) =>
let s = String.from_array(recoverArray[U8] end)
env.out.print("before")
env.out.print("'" + s + "'")
env.out.print("after")
Additional information
I ran the reproduction program (above) in lldb. Here's the backtrace after it segfaults:
We need someone to rewrite the logic in String._append to be aware of the possibility that not all strings are internally represented as being null-terminated. And we'll also want tests that prove correct behaviour in these circumstances, both for the case of zero-length string being appended, and for the case of an immutable string slice with no null-terminator, that was created via String.trim.
System
OS:
OSX 10.11.6
compiler:
0.10.0-7c7e036 [release]
compiled with: llvm 3.8.1 -- Apple LLVM version 7.3.0 (clang-703.0.29)
Issue
Observed Behavior
Using a string that is created using
String.from_array
where the array is empty results in a segmentation fault.Expected Behavior
A string that is created using
String.from_array
should behave like a zero-length string.Steps to Reproduce
This program reproduces the issue:
Additional information
I ran the reproduction program (above) in
lldb
. Here's the backtrace after it segfaults:The text was updated successfully, but these errors were encountered: