diff options
| author | Martin Uecker <uecker@tugraz.at> | 2025-10-31 16:10:40 +0100 |
|---|---|---|
| committer | Martin Uecker <uecker@gcc.gnu.org> | 2025-11-01 07:59:27 +0100 |
| commit | 5175ef7f7577a1ef4151f306161a1dab904f23bb (patch) | |
| tree | e5539a5c69613164457e83d2670f589e8e6053b5 /gcc/rust/ast/rust-expr.h | |
| parent | 806b229561f5380c00057c16bc1644dbf58cfa9b (diff) | |
| download | gcc-5175ef7f7577a1ef4151f306161a1dab904f23bb.zip gcc-5175ef7f7577a1ef4151f306161a1dab904f23bb.tar.gz gcc-5175ef7f7577a1ef4151f306161a1dab904f23bb.tar.bz2 | |
c: Fix ICE when using va_arg with arrays [PR97986]
When array type is passed to va_arg, this is undefined behavior.
Emit a warning, and insert a run-time trap after evaluating side effects,
but return the correct type for sizeof / typeof. For C90 a VLA is an
error.
PR c/97986
gcc/c/ChangeLog:
* c-parser.cc (c_parser_postfix_expression): Adapt.
* c-tree.h (c_build_va_arg): Adapt prototype.
* c-typeck.cc (c_build_va_arg): Handle UB.
gcc/testsuite/ChangeLog:
* gcc.dg/pr97986-1.c: New test.
* gcc.dg/pr97986-2.c: New test.
Diffstat (limited to 'gcc/rust/ast/rust-expr.h')
0 files changed, 0 insertions, 0 deletions
