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
Copying a smaller string into a bigger one (that is, one with a larger maximum size) results in an out-of-bounds memory copy.
Example:
let s1: String<3> = "abc"
let foo: Foo = Foo(x: 123)
let s2: String<4> = s1 // 4 bytes of memory, containing "abc" and the value 123
struct Foo {
x: u8
}
How can it be fixed
#777 introduces a StringSizeIncrease type adjustment. This could be used in MIR to insert a memcopy that copies the smaller string's number of bytes.
The text was updated successfully, but these errors were encountered:
What is wrong?
Copying a smaller string into a bigger one (that is, one with a larger maximum size) results in an out-of-bounds memory copy.
Example:
How can it be fixed
#777 introduces a
StringSizeIncrease
type adjustment. This could be used in MIR to insert a memcopy that copies the smaller string's number of bytes.The text was updated successfully, but these errors were encountered: