diff options
| author | Cliff Click <cliffc@acm.org> | 2026-10-28 13:39:05 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-10-28 13:39:05 -0700 |
| commit | 86ce5bc5d5018dcb62054d214b23f7a59b9c0d7d (patch) | |
| tree | 7b564b142c32924db354edfd8553d34cb66fff3e /chapter22/src/main/java/com | |
| parent | e481e3d215882faa82b19f29cfde5746d4e51863 (diff) | |
| download | Simple-86ce5bc5d5018dcb62054d214b23f7a59b9c0d7d.tar.gz Simple-86ce5bc5d5018dcb62054d214b23f7a59b9c0d7d.zip | |
Fix bugs x86 storing only 32bits of a large constant
Missed field narrowing in a few cases
Diffstat (limited to 'chapter22/src/main/java/com')
| -rw-r--r-- | chapter22/src/main/java/com/seaofnodes/simple/node/cpus/x86_64_v2/x86_64_v2.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chapter22/src/main/java/com/seaofnodes/simple/node/cpus/x86_64_v2/x86_64_v2.java b/chapter22/src/main/java/com/seaofnodes/simple/node/cpus/x86_64_v2/x86_64_v2.java index dc3f813e..8a578c51 100644 --- a/chapter22/src/main/java/com/seaofnodes/simple/node/cpus/x86_64_v2/x86_64_v2.java +++ b/chapter22/src/main/java/com/seaofnodes/simple/node/cpus/x86_64_v2/x86_64_v2.java @@ -550,7 +550,7 @@ public class x86_64_v2 extends Machine { private int imm( Node xval ) { assert val == null && imm == 0; - if( xval instanceof ConstantNode con && con._con instanceof TypeInteger ti) { + if( xval instanceof ConstantNode con && con._con instanceof TypeInteger ti && ti.isConstant() && imm32(ti.value()) ) { val = null; imm = (int) ti.value(); assert imm == ti.value(); // In 32-bit range |
