summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2022-06-06 09:10:24 -0700
committerSebastian Berg <sebastian@sipsolutions.net>2022-06-07 14:51:07 -0700
commitfd1f85fb70a902f9ee0f4b415e7940afe35f2830 (patch)
tree220c69bf968d4b4c3037d1e3b299b817b7e9d3dd /numpy/core
parentc7709982c99ee8c3c9d0953dc5be804023417a55 (diff)
downloadnumpy-fd1f85fb70a902f9ee0f4b415e7940afe35f2830.tar.gz
BUG: Add error return for structured resolver
We need to error return before filling in the output descriptors.
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/src/multiarray/convert_datatype.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c
index 79f918d2a..8d0a4cd56 100644
--- a/numpy/core/src/multiarray/convert_datatype.c
+++ b/numpy/core/src/multiarray/convert_datatype.c
@@ -3403,6 +3403,9 @@ void_to_void_resolve_descriptors(
/* From structured to structured, need to check fields */
casting = can_cast_fields_safety(
given_descrs[0], given_descrs[1], view_offset);
+ if (casting < 0) {
+ return -1;
+ }
}
else if (given_descrs[0]->names != NULL) {
return structured_to_nonstructured_resolve_descriptors(