Skip to content

Validate features.utf8_validation and features.message_encoding#596

Merged
mcy merged 30 commits into
mainfrom
mcy/validate-misc-features
Oct 15, 2025
Merged

Validate features.utf8_validation and features.message_encoding#596
mcy merged 30 commits into
mainfrom
mcy/validate-misc-features

Conversation

@mcy

@mcy mcy commented Oct 9, 2025

Copy link
Copy Markdown
Member

This validates that:

  • features.utf8_validation is only used on string fields.
  • features.message_encoding is only used on length-prefixed message fields.

@mcy
mcy requested a review from emcfarlane October 9, 2025 18:24
Comment thread experimental/ir/testdata/fields/empty_oneof.proto Outdated
Comment thread experimental/ir/testdata/fields/empty_oneof.proto.stderr.txt Outdated
}
=======
}
>>>>>>> mcy/editions-validation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still bad merge?

@mcy
mcy requested a review from emcfarlane October 14, 2025 20:35
prev := 0
for _, edit := range edits {
buf.WriteString(original[prev : edit.Start-start])
buf.WriteString(original[prev:max(prev, edit.Start-start)])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this occur?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happens if there are suggestion spans that overlap each other. This only happens in some pathological cases, but it was causing crashes while rendering.

@mcy
mcy merged commit da5c851 into main Oct 15, 2025
6 checks passed
@mcy
mcy deleted the mcy/validate-misc-features branch October 15, 2025 22:21
mcy added a commit that referenced this pull request Oct 16, 2025
…596)

This validates that:

- `features.utf8_validation` is only used on string fields.
- `features.message_encoding` is only used on length-prefixed message
fields.
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