mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 16:52:18 +01:00
Fix jsonfindptrs "internal error" false positive
This commit is contained in:
1 parent
dee65c0e61
commit
e915543f09
3 files changed
+10
-1
No files matched your search
@@ -786,6 +786,9 @@ compute_exit_code(std::string status_msg) {
|
|||||||
// (other non-zero exit codes). Specifically, exit code 2 for internal
|
// (other non-zero exit codes). Specifically, exit code 2 for internal
|
||||||
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
|
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
|
||||||
// linux) for a segmentation fault (e.g. null pointer dereference).
|
// linux) for a segmentation fault (e.g. null pointer dereference).
|
||||||
|
if (size_t i = status_msg.find('='); i != std::string::npos) {
|
||||||
|
status_msg = status_msg.substr(0, i);
|
||||||
|
}
|
||||||
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;
|
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -381,6 +381,9 @@ compute_exit_code(std::string status_msg) {
|
|||||||
// (other non-zero exit codes). Specifically, exit code 2 for internal
|
// (other non-zero exit codes). Specifically, exit code 2 for internal
|
||||||
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
|
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
|
||||||
// linux) for a segmentation fault (e.g. null pointer dereference).
|
// linux) for a segmentation fault (e.g. null pointer dereference).
|
||||||
|
if (size_t i = status_msg.find('='); i != std::string::npos) {
|
||||||
|
status_msg = status_msg.substr(0, i);
|
||||||
|
}
|
||||||
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;
|
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -479,7 +479,7 @@ class Callbacks : public wuffs_aux::DecodeJsonCallbacks {
|
|||||||
top.has_map_key = false;
|
top.has_map_key = false;
|
||||||
auto iter = jmap.find(top.map_key);
|
auto iter = jmap.find(top.map_key);
|
||||||
if (iter != jmap.end()) {
|
if (iter != jmap.end()) {
|
||||||
return "main: duplicate key: " + top.map_key;
|
return "main: duplicate key: key=" + top.map_key;
|
||||||
}
|
}
|
||||||
jmap.insert(iter, JsonMap::value_type(std::move(top.map_key),
|
jmap.insert(iter, JsonMap::value_type(std::move(top.map_key),
|
||||||
std::move(jvalue)));
|
std::move(jvalue)));
|
||||||
@@ -593,6 +593,9 @@ compute_exit_code(std::string status_msg) {
|
|||||||
// (other non-zero exit codes). Specifically, exit code 2 for internal
|
// (other non-zero exit codes). Specifically, exit code 2 for internal
|
||||||
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
|
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
|
||||||
// linux) for a segmentation fault (e.g. null pointer dereference).
|
// linux) for a segmentation fault (e.g. null pointer dereference).
|
||||||
|
if (size_t i = status_msg.find('='); i != std::string::npos) {
|
||||||
|
status_msg = status_msg.substr(0, i);
|
||||||
|
}
|
||||||
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;
|
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user