dotnet/runtime

`GenTreeAddrMode` has implicit truncation for its `gtOffset` field

Aberta

#86.609 aberto em 22 de mai. de 2023

 (1 comentário) (1 reação) (0 responsável)C# (5.445 forks)batch import
area-CodeGen-coreclrhelp wanted

Métricas do repositório

Stars
 (17.886 estrelas)
Métricas de merge de PR
 (Mesclagem média 12d 11h) (661 fundiu PRs em 30d)

Description

The constructor takes in and stores a ssize_t offset: https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/gentree.h#L7089

However, it returns an int Offset() which may result in implicit truncation and loss of data: https://github.com/dotnet/runtime/pull/86400

We should likely change the signature to take in an int and ensure that all taken offsets are in range.

Guia do colaborador