mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 05:20:31 +00:00
[Orc] fixes "streams.readDataStr segafaults" when accepting a string literal (#20019) [backport]
fixes streams.readDataStr accept a string literal
(cherry picked from commit 286fcef68e)
This commit is contained in:
@@ -85,3 +85,13 @@ block:
|
||||
static: # Ensure streams it doesnt break with nimscript on arc/orc #19716
|
||||
let s = newStringStream("a")
|
||||
doAssert s.data == "a"
|
||||
|
||||
template main =
|
||||
var strm = newStringStream("abcde")
|
||||
var buffer = "12345"
|
||||
doAssert strm.readDataStr(buffer, 0..3) == 4
|
||||
doAssert buffer == "abcd5"
|
||||
strm.close()
|
||||
|
||||
static: main()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user