Skip to content

[BUGFIX] Possible direction: delete the negative seek, make offset a getter - #42

Open
johanrd wants to merge 1 commit into
review/21602-failing-testfrom
review/21602-possible-fix
Open

johanrd wants to merge 1 commit into
review/21602-failing-testfrom
review/21602-possible-fix

Conversation

@johanrd

@johanrd johanrd commented Sep 10, 2026

Copy link
Copy Markdown
Owner

One possible direction for the two failures in #41. Not a proposal for emberjs#21602 itself — just what I verified turns them green.

  • Delete opcode.seek(-_size) in logOpcodeSlice. It had no readers; it was only inert before because offset was a plain field write.
  • Make RuntimeOpImpl.offset a getter over a private field, so seek is the only way to move the cursor.

Full suite on this branch: 9465 tests, 0 failures.

Caveat: trace logging already crashes on the emberjs#21602 base, in describeValue during template normalization, well before logOpcodeSlice is reached. So this fixes the second crash on a path that is already broken.

Cowritten by claude

`logOpcodeSlice` ended its walk by parking the cursor at `-_size`. That was
inert when `offset` was a plain field, but `seek` decodes the header eagerly,
so it read the heap at a negative address and threw under LOCAL_DEBUG -- which
LOCAL_TRACE_LOGGING implies. Since `debugCompiler` calls `logOpcodeSlice` for
every compiled template, template compilation died as soon as trace logging
was turned on. The line had no readers, so it is simply removed.

`RuntimeOpImpl.offset` becomes a getter over a private field. It was the one
remaining way to move the cursor without refreshing `type`, `size` and
`isMachine`, which would leave the decoded header describing one instruction
while `op1`/`op2`/`op3` read another.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01A8ja8hgWMpTns6ezSXEMzr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant