We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
write-past-end error
Code to reproduce:
class Program { class Hash { int8 _codec; uint8[] _hash ~ delete:append _; public Span<uint8> Hash => _hash; public int Length => _hash.Count; [AllowAppend] public this(Span<uint8> data) { let tmp = append uint8[data.Length]; _hash = tmp; data.CopyTo(this._hash); } } class CID { Hash _mhash ~ delete:append _; [AllowAppend] public this() { uint8[32] data = .(); Hash hash = append .(data); this._mhash = hash; } } static void Main() { CID cid = new .(); delete cid; } }
Result: Memory deallocation detected write-past-end error in 101-byte object allocation
Memory deallocation detected write-past-end error in 101-byte object allocation
Just to note if int8 _codec; is removed the code works as expected.
int8 _codec;
Tested with: (Nightly 04/28/2024) Build aa4f9f7
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Code to reproduce:
Result:
Memory deallocation detected write-past-end error in 101-byte object allocation
Just to note if
int8 _codec;
is removed the code works as expected.Tested with: (Nightly 04/28/2024) Build aa4f9f7
The text was updated successfully, but these errors were encountered: