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

Fix some issuses detected by static analyzer #4440

Merged
merged 3 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/pybind11/attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ struct process_attribute<doc> : process_attribute_default<doc> {
template <>
struct process_attribute<const char *> : process_attribute_default<const char *> {
static void init(const char *d, function_record *r) { r->doc = const_cast<char *>(d); }
static void init(const char *d, type_record *r) { r->doc = const_cast<char *>(d); }
static void init(const char *d, type_record *r) { r->doc = d; }
};
template <>
struct process_attribute<char *> : process_attribute<const char *> {};
Expand Down
2 changes: 1 addition & 1 deletion include/pybind11/eigen/tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ struct type_caster<Type, typename eigen_tensor_helper<Type>::ValidType> {
return false;
}

if (!convert && !temp.dtype().is(dtype::of<typename Type::Scalar>())) {
if (!temp.dtype().is(dtype::of<typename Type::Scalar>())) {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion include/pybind11/pytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ struct error_fetch_and_normalize {
"active exception.");
}
const char *exc_type_name_norm = detail::obj_class_name(m_type.ptr());
if (exc_type_name_orig == nullptr) {
if (exc_type_name_norm == nullptr) {
cyyever marked this conversation as resolved.
Show resolved Hide resolved
pybind11_fail("Internal error: " + std::string(called)
+ " failed to obtain the name "
"of the normalized active exception type.");
Expand Down