Repository navigation
Commit 2f6ccfa
[cppia] Report link error for new of unknown type (#1410)
* Report a cppia new with nothing to construct as a link failure.
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>
* Test a cppia new of a class the host does not have.
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>
* Adjust unlinked cppia test
Move it out of TestCommon, since that is for testing values shared
between client and host.
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Tobiasz Laskowski <tobil4sk@outlook.com>1 parent e0e0cdc commit 2f6ccfa
5 files changed
Lines changed: 38 additions & 1 deletion
File tree
- src/hx/cppia
- test/cppia
- cases
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1507 | 1507 | | |
1508 | 1508 | | |
1509 | 1509 | | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
1510 | 1517 | | |
1511 | 1518 | | |
1512 | 1519 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments