aports/main/nodejs/node_sea.patch
2025-09-20 13:43:10 +02:00

39 lines
1.7 KiB
Diff

From: Johannes Müller <50362-jogemu@users.gitlab.alpinelinux.org>
Date: Thu, 29 Aug 2025 08:06:40 +0200
Subject: Bind string as string_view via temporary variable
Cast string to string_view using a temporary variable to allow pass-by-reference to prevent error: cannot bind non-const lvalue reference of type 'std::basic_string_view&' to an rvalue of type 'std::__cxx11::basic_string::__sv_type' {aka 'std::basic_string_view'}
--- a/src/node_sea.cc
+++ b/src/node_sea.cc
@@ -331,21 +331,25 @@
return std::nullopt;
}
if (key == "main") {
- if (field.value().get_string().get(result.main_path) ||
- result.main_path.empty()) {
+ std::string_view main_path_view = result.main_path;
+ if (field.value().get_string().get(main_path_view) ||
+ main_path_view.empty()) {
FPrintF(stderr,
"\"main\" field of %s is not a non-empty string\n",
config_path);
return std::nullopt;
}
+ result.main_path = main_path_view;
} else if (key == "output") {
- if (field.value().get_string().get(result.output_path) ||
- result.output_path.empty()) {
+ std::string_view output_path_view = result.output_path;
+ if (field.value().get_string().get(output_path_view) ||
+ output_path_view.empty()) {
FPrintF(stderr,
"\"output\" field of %s is not a non-empty string\n",
config_path);
return std::nullopt;
}
+ result.output_path = output_path_view;
} else if (key == "disableExperimentalSEAWarning") {
bool disable_experimental_sea_warning;
if (field.value().get_bool().get(disable_experimental_sea_warning)) {