Repository navigation
Conversation
NewExpr::link left a NEW whose type was neither an array, a host class with a constructor, nor a script class, and both paths then dereferenced the null cppiaClass: runObject when the line ran, and genCode while the JIT compiled the module. It now reports "Could not link new" and throws "Bad link", as the other link failures do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
It would be good to turn the sample into a minimal test case that can fix cleanly into the existing cppia tests |
ClientUnlinked constructs an extern class, which the cppia module only names. Loading it must fail to link: before the fix, the JIT segfaulted while compiling the module, and without the JIT the load succeeded and left a null class to construct. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Done in 7d2d8cc: |
NewExpr::link left a NEW whose type was neither an array, a host class with a constructor, nor a script class, and both paths then dereferenced the null cppiaClass: runObject when the line ran, and genCode while the JIT compiled the module. It now reports "Could not link new" and throws "Bad link", as the other link failures do. HaxeFoundation/hxcpp#1410 Fixes #25
NewExpr::link left a NEW whose type was neither an array, a host class with a constructor, nor a script class, and both paths then dereferenced the null cppiaClass: runObject when the line ran, and genCode while the JIT compiled the module. It now reports "Could not link new" and throws "Bad link", as the other link failures do. HaxeFoundation/hxcpp#1410 Fixes #25
NewExpr::link left a NEW whose type was neither an array, a host class with a constructor, nor a script class, and both paths then dereferenced the null cppiaClass: runObject when the line ran, and genCode while the JIT compiled the module. It now reports "Could not link new" and throws "Bad link", as the other link failures do. HaxeFoundation/hxcpp#1410 Fixes #25
NewExpr::link left a NEW whose type was neither an array, a host class with a constructor, nor a script class, and both paths then dereferenced the null cppiaClass: runObject when the line ran, and genCode while the JIT compiled the module. It now reports "Could not link new" and throws "Bad link", as the other link failures do. HaxeFoundation/hxcpp#1410 Fixes #25
NewExpr::link left a NEW whose type was neither an array, a host class with a constructor, nor a script class, and both paths then dereferenced the null cppiaClass: runObject when the line ran, and genCode while the JIT compiled the module. It now reports "Could not link new" and throws "Bad link", as the other link failures do. HaxeFoundation/hxcpp#1410 Fixes #25
NewExpr::link left a NEW whose type was neither an array, a host class with a constructor, nor a script class, and both paths then dereferenced the null cppiaClass: runObject when the line ran, and genCode while the JIT compiled the module. It now reports "Could not link new" and throws "Bad link", as the other link failures do. HaxeFoundation/hxcpp#1410 Fixes #25
NewExpr::link left a NEW whose type was neither an array, a host class with a constructor, nor a script class, and both paths then dereferenced the null cppiaClass: runObject when the line ran, and genCode while the JIT compiled the module. It now reports "Could not link new" and throws "Bad link", as the other link failures do. HaxeFoundation/hxcpp#1410 Fixes #25
NewExpr::link left a NEW whose type was neither an array, a host class with a constructor, nor a script class, and both paths then dereferenced the null cppiaClass: runObject when the line ran, and genCode while the JIT compiled the module. It now reports "Could not link new" and throws "Bad link", as the other link failures do. HaxeFoundation/hxcpp#1410 Fixes #25
NewExpr::link left a NEW whose type was neither an array, a host class with a constructor, nor a script class, and both paths then dereferenced the null cppiaClass: runObject when the line ran, and genCode while the JIT compiled the module. It now reports "Could not link new" and throws "Bad link", as the other link failures do. HaxeFoundation/hxcpp#1410 Fixes #25
| Assert.equals(2, Common.callbackSet, 'Bad cppia closure'); | ||
| } | ||
|
|
||
| function testNewOfUnlinkedClass() { |
There was a problem hiding this comment.
Is there a reason why this doesn't have @:depends(testStatus), unlike the others?
There was a problem hiding this comment.
Yes: testStatus checks that client.cppia ran, and this test doesn't use it, it loads its own module (bin/unlinked.cppia). With the dependency, a failure in the main script would skip it even though what it checks still holds. I added a comment saying so in 88b11c7.
| --cppia bin/client.cppia No newline at end of file | ||
| --cppia bin/client.cppia | ||
|
|
||
| --next |
There was a problem hiding this comment.
Usually not a fan of having --next in hxmls, but I guess in this case it makes it more convenient to compile all the .cppia files needed for the test, so it's fine.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cppia
NEWnaming a class the host does not have ends the process instead of failing to link.NewExpr::linkpicks how to construct: an array type, a host class'smConstructArgs, or the script class (type->cppiaClass). When none of the three exists it carries on, and then:runObjectcallstype->cppiaClass->createInstanceon a null pointer when the line runs;genCodereadstype->cppiaClasswhile compiling the module, so loading it crashes.A script built against another version of a host reaches this, as does a generator that names a type with no runtime class (an abstract, for instance). The other link failures report and throw
"Bad link"(Could not link static ...,Could not link %s::%s), whichLoadCppiaturns into an error the host can catch.NewExpr::linknow does the same when it has nothing to construct.Repro (host, two ASCII cppia scripts that differ only in the class name): hxcpp-cppia-new-unlinked-class.zip.
With
master,new Missing()segfaults with and without the JIT; with the fix, both printCould not link new Missingand the load throwsBad link, while the script constructing a host class still runs.test/cppia(CppiaHost, with and without-jit): ALL TESTS OK, 15/15 in both.