dotnet/runtime

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

Open

#86.609 aperta il 22 mag 2023

Vedi su GitHub
 (1 commento) (1 reazione) (0 assegnatari)C# (5445 fork)batch import
area-CodeGen-coreclrhelp wanted

Metriche repository

Star
 (17.886 star)
Metriche merge PR
 (Merge medio 12g 11h) (661 PR mergiate in 30 g)

Descrizione

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.

Guida contributor