Pin the temporary-Entity lifetime #367 reports - #804
Merged
Conversation
#367 says a method called on a temporary Entity throws NonExistentObjectAddressingException, the temporary having been destroyed and its handle released before the call using it returned: auto simplified = AngouriMath::Entity("x + 2").Simplify(); Measured against master, it does not reproduce -- that line answers `2 + x`. `work/TRIAGE.md` had this recorded as unreachable, on the grounds that there is no C++ toolchain set up here. That was wrong, and is the fifth recorded blocker in this file to fall on being re-measured rather than read. There is g++ 15.2 and make; only cmake is missing, and the native AOT export publishes fine on linux-x64, so the wrapper can be compiled and run directly against the .so without it. Five tests rather than one, because a lifetime bug that is gone should be gone in every shape it would have shown in: the issue's own line, a result outliving the temporary it came from, two calls chained off one temporary, a result copied out of the scope that made it, and two hundred repetitions to shake loose a handle that is freed but not yet reused. All 28 tests in the file compile and pass against the native library built from this commit. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #367 — as already fixed, with the coverage it never had.
#367 reports that a method called on a temporary
EntitythrowsNonExistentObjectAddressingException, the temporary having been destroyed and its handle released before the call using it returned:Measured against master, it does not reproduce — that line answers
2 + x.The recorded blocker was wrong
work/TRIAGE.mdhad this down as unreachable because there is no C++ toolchain here. There is: g++ 15.2 and make. Onlycmakeis missing, and the native AOT export publishes fine onlinux-x64, so the wrapper compiles and runs directly against the.sowithout it.That is the fifth blocker recorded in that file to fall on being re-measured rather than read.
Five tests, not one
A lifetime bug that is gone should be gone in every shape it would have shown in:
TemporaryEntityOutlivesTheCallOnItResultOutlivesTheTemporaryItCameFromTwoCallsChainedOffOneTemporary.Simplify().Differentiate("x")ResultCopiedOutOfTheScopeThatMadeItManyTemporariesDoNotReleaseAHandleInUseAll 28 tests in the file compile and pass against the native library built from this commit.
🤖 Generated with Claude Code