middle-end/100547 - check rtvec_alloc size
authorRichard Biener <rguenther@suse.de>
Wed, 12 May 2021 07:07:42 +0000 (09:07 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 12 May 2021 08:47:59 +0000 (10:47 +0200)
commit229a6dbd9ef1680f1ca02d6ce63e8abdffaaeeba
tree594f0f1f8e93cf0840b6b86a84cead2e9865da56
parent19040050aa2c8ee890fc58dda48639fc91bf0af0
middle-end/100547 - check rtvec_alloc size

This makes the rtvec_alloc argument size_t catching overflow and
truncated arguments (from "invalid" testcases), verifying the
argument against INT_MAX which is the limit set by the int
typed rtvec_def.num_elem member.

2021-05-12  Richard Biener  <rguenther@suse.de>

PR middle-end/100547
* rtl.h (rtvec_alloc): Make argument size_t.
* rtl.c (rtvec_alloc): Verify the count is less than INT_MAX.
gcc/rtl.c
gcc/rtl.h