You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| memory access failed: pointer must be in-bounds at offset 40, but is outside bounds of alloc4 which has size 4
8
-
| inside `copy_nonoverlapping::<i32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
9
-
| inside `COPY_OOB_1` at $DIR/copy-intrinsic.rs:16:5
10
-
|
11
-
::: $DIR/copy-intrinsic.rs:12:1
2
+
--> $DIR/copy-intrinsic.rs:27:5
12
3
|
13
4
LL | / const COPY_OOB_1: () = unsafe {
14
5
LL | | let mut x = 0i32;
15
6
LL | | let dangle = (&mut x as *mut i32).wrapping_add(10);
16
7
LL | | // Even if the first ptr is an int ptr and this is a ZST copy, we should detect dangling 2nd ptrs.
17
-
... |
8
+
LL | | copy_nonoverlapping(0x100 as *const i32, dangle, 0);
9
+
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: pointer must be in-bounds at offset 40, but is outside bounds of alloc4 which has size 4
10
+
LL | |
18
11
LL | |
19
12
LL | | };
20
13
| |__-
@@ -24,22 +17,15 @@ LL | | };
24
17
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
| memory access failed: pointer must be in-bounds at offset 40, but is outside bounds of alloc6 which has size 4
33
-
| inside `copy_nonoverlapping::<i32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
34
-
| inside `COPY_OOB_2` at $DIR/copy-intrinsic.rs:24:5
35
-
|
36
-
::: $DIR/copy-intrinsic.rs:20:1
20
+
--> $DIR/copy-intrinsic.rs:35:5
37
21
|
38
22
LL | / const COPY_OOB_2: () = unsafe {
39
23
LL | | let x = 0i32;
40
24
LL | | let dangle = (&x as *const i32).wrapping_add(10);
41
25
LL | | // Even if the second ptr is an int ptr and this is a ZST copy, we should detect dangling 1st ptrs.
42
-
... |
26
+
LL | | copy_nonoverlapping(dangle, 0x100 as *mut i32, 0);
27
+
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: pointer must be in-bounds at offset 40, but is outside bounds of alloc6 which has size 4
28
+
LL | |
43
29
LL | |
44
30
LL | | };
45
31
| |__-
@@ -48,21 +34,13 @@ LL | | };
48
34
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
49
35
50
36
error: any use of this value will cause an error
51
-
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
52
-
|
53
-
LL | unsafe { copy(src, dst, count) }
54
-
| ^^^^^^^^^^^^^^^^^^^^^
55
-
| |
56
-
| overflow computing total size of `copy`
57
-
| inside `std::intrinsics::copy::<i32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
58
-
| inside `COPY_SIZE_OVERFLOW` at $DIR/copy-intrinsic.rs:32:5
0 commit comments