Skip to content

Ast: store length of string literal instead of size#516

Closed
chqrlie wants to merge 1 commit intoc2lang:masterfrom
chqrlie:string-literal
Closed

Ast: store length of string literal instead of size#516
chqrlie wants to merge 1 commit intoc2lang:masterfrom
chqrlie:string-literal

Conversation

@chqrlie
Copy link
Copy Markdown
Contributor

@chqrlie chqrlie commented Apr 21, 2026

  • add StringLiteral.getLength() to get the length in bytes of a string literal ast node, and make this the stored value it is used more often than the size, which includes the trailing null terminator
  • add TODOs in IR generator regarding embedded null bytes in string literals

* add `StringLiteral.getLength()` to get the length in bytes of a
  string literal ast node, and make this the stored value it is used
  more often than the size, which includes the trailing null terminator
* add TODOs in IR generator regarding embedded null bytes in string literals
@bvdberg
Copy link
Copy Markdown
Member

bvdberg commented Apr 22, 2026

merged

@bvdberg bvdberg closed this Apr 22, 2026
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.

2 participants