This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PING**2] [PATCH] Fix not properly nul-terminated string constants in JIT
- From: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, David Malcolm <dmalcolm at redhat dot com>, Jeff Law <law at redhat dot com>, Richard Biener <rguenther at suse dot de>
- Date: Wed, 10 Oct 2018 19:43:49 +0000
- Subject: [PING**2] [PATCH] Fix not properly nul-terminated string constants in JIT
- References: <AM5PR0701MB2657D814EBE588723929D667E4210@AM5PR0701MB2657.eurprd07.prod.outlook.com> <AM5PR0701MB265792CD3DD0EF032E5E7C77E4340@AM5PR0701MB2657.eurprd07.prod.outlook.com>
Ping...
On 08/26/18 21:40, Bernd Edlinger wrote:
> Ping...
>
> This is just plain wrong, independent
> of any STRING_CST semantic issues.
>
> The original patch (retested on current trunk) is
> here: https://gcc.gnu.org/ml/gcc-patches/2018-08/msg00370.html
>
>
> On 08/05/18 18:59, Bernd Edlinger wrote:
>> Hi!
>>
>>
>> My other patch with adds assertions to varasm.c regarding correct
>> nul termination of sting literals did make these incorrect string
>> constants in JIT frontend fail.
>>
>> The string constants are not nul terminated if their length exceeds
>> 200 characters. The test cases do not use strings of that size where
>> that would make a difference. But using a fixed index type is clearly
>> wrong.
>>
>> This patch removes the fixed char[200] array type from playback::context,
>> and uses build_string_literal instead of using build_string directly.
>>
>>
>> Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
>> Is it OK for trunk?
>>
>>
>> Thanks
>> Bernd.