Skip to content
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

src: fix warning in string_search.h #37146

Closed

Conversation

RaisinTen
Copy link
Contributor

Fixes: #37145

@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. labels Jan 30, 2021
@nodejs-github-bot
Copy link
Collaborator

@targos
Copy link
Member

targos commented Jan 30, 2021

The change looks OK, but I opened the issue because I'm not sure it's enough to just fix the warning.

@RaisinTen
Copy link
Contributor Author

@targos I realise that the code here matches this:
https://chromium.googlesource.com/v8/v8.git/+/refs/heads/master/src/strings/string-search.h#415
Do you know why the code is duplicated here if we already have a copy in deps/v8?

@targos
Copy link
Member

targos commented Jan 31, 2021

We cannot use that code from V8 as it is not part of their public API.

@RaisinTen
Copy link
Contributor Author

In that case should we prefer using the types that were used originally?

@addaleax
Copy link
Member

In that case should we prefer using the types that were used originally?

V8 implements this for strings. Strings in JS have a bounded size, which is smaller than INT_MAX. We implement this for Buffers, which also have a bounded size, but that size doesn’t fit into an int (at least on 64-bit platforms).

@RaisinTen RaisinTen added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 3, 2021
@jasnell
Copy link
Member

jasnell commented Feb 4, 2021

Landed in c148c3a

@jasnell jasnell closed this Feb 4, 2021
jasnell pushed a commit that referenced this pull request Feb 4, 2021
Fixes: #37145

PR-URL: #37146
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
@RaisinTen RaisinTen deleted the src/fix-warning-in-string_search.h branch February 5, 2021 13:34
danielleadams pushed a commit that referenced this pull request Feb 16, 2021
Fixes: #37145

PR-URL: #37146
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
This was referenced Feb 16, 2021
targos pushed a commit that referenced this pull request May 1, 2021
Fixes: #37145

PR-URL: #37146
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
@danielleadams danielleadams mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Concerning compilation warning in string_search.h
8 participants