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
I am currently writing a chess engine in AssemblyScript and for optimization purposes I wanted to replace some Arrays with TypedArrays.
Unfortunately, after the change some of my unit tests started to fail with error "An orphaned decrement has occurred...".
After some debugging, I noticed that the error seems to occur when sorting the array.
Here is a minimal code snippet to reproduce the error:
functionreproduceBug(): i32{letmoves=newInt32Array(1);moves[0]=1;moves.sort();returnmoves[0];}describe("Bug?",()=>{it("causes error 'An orphaned decrement has occured'",()=>{constresult=reproduceBug();expect(result).toBe(1);});})
Here is the error message when running the test with as-pect:
[Error]: Orphaned Decrement Error: An orphaned decrement has occurred at block: 4784
[Stack]: at ~lib/rt/pure/decrement (wasm-function[54]:23)
at ~lib/rt/pure/__release (wasm-function[55]:13)
at assembly/__tests__/util.spec/reproduceBug (wasm-function[127]:41)
at start:assembly/__tests__/util.spec~anonymous|5~anonymous|0 (wasm-function[129]:3)
at node_modules/@as-pect/assembly/assembly/internal/call/__call (wasm-function[133]:7)
AssemblyScript version: 0.8.1
The text was updated successfully, but these errors were encountered:
Hi,
I am currently writing a chess engine in AssemblyScript and for optimization purposes I wanted to replace some Arrays with TypedArrays.
Unfortunately, after the change some of my unit tests started to fail with error "An orphaned decrement has occurred...".
After some debugging, I noticed that the error seems to occur when sorting the array.
Here is a minimal code snippet to reproduce the error:
Here is the error message when running the test with as-pect:
AssemblyScript version: 0.8.1
The text was updated successfully, but these errors were encountered: