Repository navigation
Conversation
Under HXCPP_CHECK_POINTER, a call on a null array in a cppia script throws Null Object Reference: a typed array's builtins check the array first, and so do Array<Dynamic>'s element access, pop, slice and the other calls that return an object. push, contains, remove, indexOf, lastIndexOf, join, toString, sort, insert and unshift did not, and called through the null, which ended the process, interpreted and under the JIT alike, since the JIT calls the same code for them. They check it as the others do, and the JIT checks the array once it has it, as the typed arrays' code does. Tests: test/regression/CppiaNullDynamicArray calls each of them on a null Array<Dynamic>, interpreted and under the JIT. Before, the first call ended the host with a segmentation fault. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
It got conflicted. |
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.
Under
HXCPP_CHECK_POINTER, a call on a null array in a cppia script throwsNull Object Reference: a typed array's builtins check the array first, and so doArray<Dynamic>'s element access,pop,sliceand the other calls that return an object.push,contains,remove,indexOf,lastIndexOf,join,toString,sort,insertandunshiftdid not. They called through the null, which ended the process with a segmentation fault, both interpreted and under the JIT, since the JIT calls the same code for them.ArrayBuiltinAnynow checks the array withCPPIA_CHECKin these calls, as the others do, and itsgenCodechecks it withgenNullReferenceExceptionCheckonce it has it, as the typed arrays' code does. WithoutHXCPP_CHECK_POINTER, nothing changes.Tests:
test/regression/CppiaNullDynamicArraycalls each of them, pluspopand an element read, on a nullArray<Dynamic>, interpreted and then under the JIT. Before, the first call ended the host. Alltest/regression/Cppia*cases pass.