File: fix-unaligned-access.patch

package info (click to toggle)
h5py 3.14.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,824 kB
  • sloc: python: 11,425; ansic: 578; makefile: 429; sh: 33
file content (29 lines) | stat: -rw-r--r-- 961 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Index: h5py-3.10.0/h5py/_conv.pyx
===================================================================
--- h5py-3.10.0.orig/h5py/_conv.pyx
+++ h5py-3.10.0/h5py/_conv.pyx
@@ -705,9 +705,10 @@ cdef int conv_vlen2ndarray(void* ipt,
         vlen_t in_vlen0
         size_t size, itemsize
 
-    #Replaces the memcpy
-    size = in_vlen0.len = in_vlen[0].len
-    data = in_vlen0.ptr = in_vlen[0].ptr
+    memcpy(&size, &in_vlen[0].len, sizeof(size_t))
+    memcpy(&data, &in_vlen[0].ptr, sizeof(void*))
+    in_vlen0.len = size
+    in_vlen0.ptr = data
 
     dims[0] = size
     itemsize = H5Tget_size(outtype.id)
@@ -869,8 +870,8 @@ cdef int conv_ndarray2vlen(void* ipt,
 
         H5Tconvert(intype.id, outtype.id, len, data, back_buf, H5P_DEFAULT)
 
-        in_vlen[0].len = len
-        in_vlen[0].ptr = data
+        memcpy(&in_vlen[0].len, &len, sizeof(size_t))
+        memcpy(&in_vlen[0].ptr, &data, sizeof(void*))
 
     finally:
         free(back_buf)