]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Fix ICE when array elements are not a value
authorPhilip Herron <herron.philip@googlemail.com>
Wed, 26 Mar 2025 17:11:36 +0000 (17:11 +0000)
committerPhilip Herron <philip.herron@embecosm.com>
Thu, 27 Mar 2025 13:21:56 +0000 (13:21 +0000)
commit23097f8132bcaf252020ed04758af71365758a8f
tree4e34c1ceb2b46caaa14b1dce30ab51d3b5016d03
parentb322656cdc0e3beae61be8465adab23fbcc3dbbf
gccrs: Fix ICE when array elements are not a value

We need to check for error_mark_node when doing adjustments from coercion
sites otherwise we hit assetions as part of the coercion. That fixes the
ICE but the reason for the error_mark_node is because the array element
value.

Fixes Rust-GCC#3567

gcc/rust/ChangeLog:

* backend/rust-compile-expr.cc (CompileExpr::array_value_expr): add value chk for array expr

gcc/testsuite/ChangeLog:

* rust/compile/issue-3567.rs: New test.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/backend/rust-compile-expr.cc
gcc/testsuite/rust/compile/issue-3567.rs [new file with mode: 0644]