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:
On latest nightly (439ae8d) this is no longer an issue. I believe that recent fix to append resolved that.
append
On one of the older builds I have, this does happen:
FATAL ERROR Memory deallocation detected write-past-end error in 101-byte object allocation at 0xBF0'110200E0 in C:\Beef\BeefRT\dbg\gc.cpp:982
Sorry, something went wrong.
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: