diff options
| author | Cliff Click <cliffc@acm.org> | 2026-10-19 11:48:37 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-10-19 11:48:37 -0700 |
| commit | 3617495d8efbcce23bbc9f1754c7d27d34d30a52 (patch) | |
| tree | 65684567f224af8018626dc52d529e206af1a659 /skills/chapter25-codex-notes.md | |
| parent | e7eb2db06d1b9c529f94f2da3a087c83c0498e05 (diff) | |
| download | Simple-3617495d8efbcce23bbc9f1754c7d27d34d30a52.tar.gz Simple-3617495d8efbcce23bbc9f1754c7d27d34d30a52.zip | |
Fix a missed int-widening around recursion
Diffstat (limited to 'skills/chapter25-codex-notes.md')
| -rw-r--r-- | skills/chapter25-codex-notes.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/skills/chapter25-codex-notes.md b/skills/chapter25-codex-notes.md index f16407e7..9b861a18 100644 --- a/skills/chapter25-codex-notes.md +++ b/skills/chapter25-codex-notes.md @@ -757,6 +757,13 @@ Consequences: widen only below-center nonconstant ranges: above-center widening can fall to an unwidened constant, violating SCCP monotonicity. Existing Chapter14/21 tests exposed this during the backport. +- Recursion needs two widening points in Chapters 24-25: ParmNode for arguments, + and CallEndNode for results. The return cycle in `f(x-1)+1` never crosses the + Parm. Keep the comments at both sites and PhiNode cross-linked. Chapter 25's + FunPtrNode follows the live Return range; join that range before widening, + then bound widening by the callee signatures, not that live range. Apply the + same rule before and after linking, and retain narrow results such as i32. + `Chapter24Test.testRecursiveWidening` checks both cycles in both chapters. - TypeConAry's `_make(any,widen)` shares the backing array and returns an uninterned type. `xdual()` must leave interning to Type.intern's dual-pair setup; ordinary factories and ymeet's widening replacement intern their results. |
