Skip to content

Prevent /**/ from being parsed as a doc comment #28932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2015

Conversation

barosl
Copy link
Contributor

@barosl barosl commented Oct 9, 2015

Previously, /**/ was incorrectly regarded as a doc comment because it starts with /** and ends with */. However, this caused an ICE because some code assumed that the length of a doc comment is at least 5. This commit adds an additional check to is_block_doc_comment that tests the length of the input.

Fixes #28844.

@rust-highfive
Copy link
Contributor

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@barosl barosl changed the title Prevent "/**/" from being parsed as a doc comment Prevent /**/ from being parsed as a doc comment Oct 9, 2015
Previously, `/**/` was incorrectly regarded as a doc comment because it
starts with `/**` and ends with `*/`. However, this caused an ICE
because some code assumed that the length of a doc comment is at least
5. This commit adds an additional check to `is_block_doc_comment` that
tests the length of the input.

Fixes rust-lang#28844.
@alexcrichton
Copy link
Member

@bors: r+ c7fa52d

Thanks!

@bors
Copy link
Collaborator

bors commented Oct 10, 2015

⌛ Testing commit c7fa52d with merge b6fd615...

bors added a commit that referenced this pull request Oct 10, 2015
Previously, `/**/` was incorrectly regarded as a doc comment because it starts with `/**` and ends with `*/`. However, this caused an ICE because some code assumed that the length of a doc comment is at least 5. This commit adds an additional check to `is_block_doc_comment` that tests the length of the input.

Fixes #28844.
@bors bors merged commit c7fa52d into rust-lang:master Oct 10, 2015
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.

4 participants