Skip to content

fix: valid double literal for void function return assignment#247

Merged
cs01 merged 2 commits intomainfrom
fix/void-return-assignment
Mar 11, 2026
Merged

fix: valid double literal for void function return assignment#247
cs01 merged 2 commits intomainfrom
fix/void-return-assignment

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 11, 2026

Summary

  • Assigning a void function's return value (const x = voidFn()) generated invalid LLVM IR: store double 0 instead of store double 0.0
  • The bare 0 is an integer literal in LLVM IR, not a valid double — this caused opt to reject the IR
  • Fix: convert the "0" placeholder to "0.0" before emitting the double store

Test plan

  • New fixture functions/void-return-assignment.ts passes
  • npm run verify:quick passes (tests + Stage 1 self-hosting)

🤖 Generated with Claude Code

@cs01 cs01 merged commit 940c0bd into main Mar 11, 2026
12 checks passed
@cs01 cs01 deleted the fix/void-return-assignment branch March 12, 2026 05:35
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