Commit 10631d7
fix: improve Memoize test pass rate
Two independent fixes targeting failures seen in `jcpan -t Memoize`:
1. Storable::last_op_in_netorder: implement the flag that reports
whether the most recent freeze/store used network byte order. Set by
nfreeze()/nstore(), cleared by freeze()/store(). Unblocks
t/tie_storable.t.
2. "Deep recursion on subroutine" warning: RuntimeCode now tracks
per-sub recursion depth and warns (under the "recursion" category)
the first time depth exceeds 100, matching Perl's
PERL_SUB_DEPTH_WARN behavior. Map/grep/eval blocks and builtins are
exempt. Unblocks t/correctness.t (which relied on the warning firing
before StackOverflowError).
Test results for `jcpan -t Memoize` on this branch:
- Before: t/correctness.t crashed with StackOverflowError after test 16;
t/tie_storable.t died at test 6 with "Undefined subroutine
&Storable::last_op_in_netorder".
- After: correctness.t 17/17 pass; tie_storable.t 5/6 pass (test 6
requires tied-hash DESTROY at scope exit, a separate pre-existing
limitation).
threads->new / ->join stubs were considered but rejected: running a
thread body synchronously in the current thread silently produces
incorrect results whenever the code relies on thread isolation (as
Memoize's t/threadsafe.t test 8 demonstrated — unmemoize ran for real
on the main thread). Leaving t/threadsafe.t failing loudly is safer
than shipping a convincing-but-wrong stub.
t/tie.t and t/tie_db.t failures are caused by a broken user-local
DB_File.pm AUTOLOAD (CPAN-installed; DB_File needs XS and is not
supported on PerlOnJava) and are not addressed here.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>1 parent d19b693 commit 10631d7
3 files changed
Lines changed: 128 additions & 5 deletions
File tree
- src/main/java/org/perlonjava
- core
- runtime
- perlmodule
- runtimetypes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
85 | 99 | | |
86 | 100 | | |
87 | 101 | | |
88 | 102 | | |
89 | 103 | | |
90 | 104 | | |
| 105 | + | |
91 | 106 | | |
92 | 107 | | |
93 | 108 | | |
| |||
432 | 447 | | |
433 | 448 | | |
434 | 449 | | |
435 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
436 | 453 | | |
437 | 454 | | |
438 | 455 | | |
439 | 456 | | |
440 | 457 | | |
441 | 458 | | |
| 459 | + | |
442 | 460 | | |
443 | 461 | | |
444 | 462 | | |
| |||
479 | 497 | | |
480 | 498 | | |
481 | 499 | | |
482 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
483 | 503 | | |
484 | 504 | | |
485 | 505 | | |
| |||
Lines changed: 104 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
346 | 412 | | |
347 | 413 | | |
348 | 414 | | |
| |||
2330 | 2396 | | |
2331 | 2397 | | |
2332 | 2398 | | |
2333 | | - | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
2334 | 2409 | | |
2335 | 2410 | | |
2336 | 2411 | | |
| |||
2669 | 2744 | | |
2670 | 2745 | | |
2671 | 2746 | | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
2672 | 2764 | | |
2673 | 2765 | | |
2674 | 2766 | | |
| |||
3163 | 3255 | | |
3164 | 3256 | | |
3165 | 3257 | | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
3166 | 3263 | | |
3167 | 3264 | | |
3168 | 3265 | | |
| |||
3183 | 3280 | | |
3184 | 3281 | | |
3185 | 3282 | | |
| 3283 | + | |
3186 | 3284 | | |
3187 | 3285 | | |
3188 | 3286 | | |
| |||
3268 | 3366 | | |
3269 | 3367 | | |
3270 | 3368 | | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
3271 | 3373 | | |
3272 | 3374 | | |
3273 | 3375 | | |
| |||
3288 | 3390 | | |
3289 | 3391 | | |
3290 | 3392 | | |
| 3393 | + | |
3291 | 3394 | | |
3292 | 3395 | | |
3293 | 3396 | | |
| |||
0 commit comments