[v8.x] src: fix fs.write() externalized string handling#22731
[v8.x] src: fix fs.write() externalized string handling#22731addaleax wants to merge 2 commits intonodejs:v8.x-stagingfrom
Conversation
|
@addaleax should this be included in the 8.12.0 release or is it ok to wait until 8.12.1? |
|
@MylesBorins It’s hard to tell – I’d be in favour of including it. It’s been in @jasnell The tests added here do check the broken code path in |
As long as there is appropriate coverage for this particular piece then it should be fine. |
|
Resume build: https://ci.nodejs.org/job/node-test-pull-request/17206/ |
|
This PR seems to be making windows completely fail, any idea what's up? |
|
It's some sort of compilation failure, e.g. https://ci.nodejs.org/job/node-compile-windows/21107/label=win-vs2015/console |
|
src\string_bytes.cc(341): Among the search results for |
|
@addaleax are you able to take a look? Thanks |
Build with `-DNOMINMAX` to stop `<windows.h>` from defining macros that conflict with `std::min()` and `std::max()`. PR-URL: nodejs#18216 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
* Respect `encoding` argument when the string is externalized. * Copy the string when the write request can outlive the externalized string. This commit removes `StringBytes::GetExternalParts()` because it is fundamentally broken. Fixes: nodejs#18146 Fixes: nodejs#22728 PR-URL: nodejs#18216
ed7b009 to
590aa1f
Compare
|
@BethGriggs Thanks for the ping! |
Build with `-DNOMINMAX` to stop `<windows.h>` from defining macros that conflict with `std::min()` and `std::max()`. Backport-PR-URL: #22731 PR-URL: #18216 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> PR-URL: #22731
* Respect `encoding` argument when the string is externalized. * Copy the string when the write request can outlive the externalized string. This commit removes `StringBytes::GetExternalParts()` because it is fundamentally broken. Fixes: #18146 Fixes: #22728 Backport-PR-URL: #22731 PR-URL: #18216 Reviewed-By: James M Snell <jasnell@gmail.com>
|
Landed in |
Backport #18216
The merge conflicts in
node_file.ccwere non-trivial, so the changes there deserve to be treated like original content during review.