Skip to content

Fix ASM frame crash in atan2 and exists/delete operators#298

Merged
fglock merged 2 commits intomasterfrom
fix/asm-crash-atan2-exists
Mar 10, 2026
Merged

Fix ASM frame crash in atan2 and exists/delete operators#298
fglock merged 2 commits intomasterfrom
fix/asm-crash-atan2-exists

Conversation

@fglock
Copy link
Owner

@fglock fglock commented Mar 10, 2026

Summary

Follow-up to PR #297: Apply the same spill pattern to additional operators that were missing it.

Fixed operators:

  • atan2 function - e.g., atan2(0, CONST)
  • exists/delete with compound dereference - e.g., exists $h{key}[CONST]

Root cause: These operators were not spilling their left operand before evaluating the right side, causing "Incompatible stack heights" errors when the RHS was a constant sub call.

Test plan

  • Unit tests pass (162/162)
  • atan2(0, CONST) no longer crashes
  • exists $h{key}[CONST] no longer crashes

Generated with Devin

fglock and others added 2 commits March 10, 2026 16:34
Follow-up to PR #297: Apply the same spill pattern to additional
operators that were missing it:

- atan2 function - e.g., atan2(0, CONST)
- exists/delete with compound dereference - e.g., exists $h{key}[CONST]

These operators were not spilling their left operand before evaluating
the right side, causing "Incompatible stack heights" errors when the
RHS was a constant sub call.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
- Add warnFlag field to CompilerOptions for -w flag
- Set $^W=1 at initialization time instead of prepending BEGIN block
- Remove "use warnings" prepending for -w (only $^W needed)
- This fixes line number offset in warning messages
- Refactor $^W access to use GlobalContext.encodeSpecialVar("W")

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
@fglock fglock merged commit 257f982 into master Mar 10, 2026
2 checks passed
@fglock fglock deleted the fix/asm-crash-atan2-exists branch March 10, 2026 16:03
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