RFR: 8267908: linux: thread_native_entry can scribble on stack frame

David Holmes david.holmes at oracle.com
Tue Jun 8 06:53:09 UTC 2021


On 8/06/2021 4:32 pm, Xin Liu wrote:
> On Tue, 8 Jun 2021 02:02:55 GMT, David Holmes <dholmes at openjdk.org> wrote:
> 
>> Please review this trivial fix to ensure we do not try to alloca zero bytes.
>>
>> Thanks,
>> David
> 
> I know. you patch LGTM. that is a side note.
> 
> I was worried about this statement was not portable if random is 1.
> `*(char *)stackmem = 1;`
> 
> C++ std 6.5.3.4 says:
> 
> When sizeof is applied  to  an  operand  that  has  type char, unsigned  char, or signed  char,  (or  a qualified  version  thereof)  the  result  is  1.
> 
> 
> Therefore, it's portable.

Yes it is portable - that was never in question. :)

David

> -------------
> 
> PR: https://git.openjdk.java.net/jdk/pull/4407
> 


More information about the hotspot-runtime-dev mailing list