mirror of
https://github.com/vlang/v.git
synced 2025-09-16 19:06:24 -04:00
fix: segfault when using string.ustring_tmp()
This commit is contained in:
parent
09c447e2b8
commit
58577f57c6
@ -653,6 +653,9 @@ pub fn (s string) ustring() ustring {
|
|||||||
// right away. Uses global buffer for storing runes []int array.
|
// right away. Uses global buffer for storing runes []int array.
|
||||||
__global g_ustring_runes []int
|
__global g_ustring_runes []int
|
||||||
pub fn (s string) ustring_tmp() ustring {
|
pub fn (s string) ustring_tmp() ustring {
|
||||||
|
if g_ustring_runes.len == 0 {
|
||||||
|
g_ustring_runes = new_array(0, 128, sizeof(int))
|
||||||
|
}
|
||||||
mut res := ustring {
|
mut res := ustring {
|
||||||
s: s
|
s: s
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user