diff options
| author | Cliff Click <cliffc@acm.org> | 2026-10-25 09:51:44 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-10-25 09:51:44 -0700 |
| commit | 4051ce7cd26314f01dc8c0237899a742e0ab2084 (patch) | |
| tree | 29cb9b47e0461c34be1797ac36dd31e8f0b10c09 /docs/chapter-backports.md | |
| parent | 5cfb046c8306a81ec40be82a59015f16f654fa93 (diff) | |
| download | Simple-4051ce7cd26314f01dc8c0237899a742e0ab2084.tar.gz Simple-4051ce7cd26314f01dc8c0237899a742e0ab2084.zip | |
Fix ++x in methods
Fix ideaj setups
Diffstat (limited to 'docs/chapter-backports.md')
| -rw-r--r-- | docs/chapter-backports.md | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/docs/chapter-backports.md b/docs/chapter-backports.md index 6e6d1d5c..1c2ffb85 100644 --- a/docs/chapter-backports.md +++ b/docs/chapter-backports.md @@ -111,32 +111,26 @@ language restriction into Chapters 10-24 or the named pre-module snapshots. Establish an earlier-chapter failure before changing compiler behavior. -### Prefix update of an enclosing class field +### Narrow stores in the ideal evaluator -The following returns 11 instead of 21 in numbered Chapter 25, Modules, and -Separate Compilation: +The prefix-update regression exposed an independent evaluator bug. In Chapter +23, this postfix-only example returns 25710 in Eval2 instead of 110: ```simple -int calls=0; -val next_noInline={ -> ++calls; }; -return next_noInline()+10*next_noInline(); -``` - -The prefix path updates an enclosing parser slot instead of class memory. -Postfix `calls++; return calls;` works and is used in the new chapter example. -This is independent of importing IR. The stage audit also reproduced the -instance-method form in Chapter 23, where methods first appear: - -```simple -struct C { int x=0; val inc={ -> ++x; }; }; +struct C { u8 x=255; val next_noInline={ -> x++; return x; }; }; var c=new C; -return c.inc()+10*c.inc(); +val a=c.next_noInline(); +val b=c.next_noInline(); +return a+10*b+100*c.x; ``` -It returns 11 instead of 21 in Chapters 23 and 26. Prefix lookup bypasses the -ordinary field-access path. A fix should share name resolution with other -reads/updates while preserving constructor locals, and propagate from 23 -through 28b. No fix is included in the numbering change. +`Eval2.store` copies the raw value into its Java object array. It does not +truncate to the field width, even though Store optimization removes masks that +machine stores perform implicitly. The native prefix-update regression checks +that the stored byte wraps and the expression returns the converted value. +Establish the first affected evaluator and check signed fields and floating +rounding before propagating a fix. Do not change valid generated code to match +an incorrect ideal evaluator. ### Constructor loop with break/continue: worklist assertion |
