Commit 573c26a
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 860ae72 commit 573c26a
File tree
2 files changed
+15
-0
lines changed- gcc
- rust/backend
- testsuite/rust/compile
2 files changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2029 | 2029 | | |
2030 | 2030 | | |
2031 | 2031 | | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
2032 | 2043 | | |
2033 | 2044 | | |
2034 | 2045 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments