Commit 5ff14a9
committed
Emit error on array size overflow
When the byte size required for an array overflow we should emit an
error.
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (CompileExpr::array_copied_expr): Check
for overflow on array memory size and emit an error.
gcc/testsuite/ChangeLog:
* rust/compile/issue-3962.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>1 parent fe2320d commit 5ff14a9
File tree
2 files changed
+16
-0
lines changed- gcc
- rust/backend
- testsuite/rust/compile
2 files changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2045 | 2045 | | |
2046 | 2046 | | |
2047 | 2047 | | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
2048 | 2059 | | |
2049 | 2060 | | |
2050 | 2061 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments