Skip to content

fix: prevent crash when concatenating null strings with + operator#243

Merged
cs01 merged 1 commit intomainfrom
fix/null-string-concat
Mar 11, 2026
Merged

fix: prevent crash when concatenating null strings with + operator#243
cs01 merged 1 commit intomainfrom
fix/null-string-concat

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 11, 2026

Summary

  • "val: " + nullString now correctly produces "val: null" instead of crashing (segfault from strlen(null))
  • Null literal and undefined literal expressions produce "null" and "undefined" strings directly
  • Nullable string variables are null-checked at runtime with a select instruction

Test plan

  • New fixture strings/string-concat-null.ts tests null, non-null, and normal string concatenation
  • npm run verify:quick passes (all tests + Stage 1 self-hosting)

🤖 Generated with Claude Code

@cs01 cs01 force-pushed the fix/null-string-concat branch from a6ea56e to 4898364 Compare March 11, 2026 20:23
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cs01 cs01 force-pushed the fix/null-string-concat branch from 4898364 to 5e01530 Compare March 11, 2026 20:29
@cs01 cs01 merged commit e15e808 into main Mar 11, 2026
12 checks passed
@cs01 cs01 deleted the fix/null-string-concat 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