dotnet/runtime

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

Open

#86 609 ouverte le 22 mai 2023

Voir sur GitHub
 (1 commentaire) (1 réaction) (0 assignés)C# (5 445 forks)batch import
area-CodeGen-coreclrhelp wanted

Métriques du dépôt

Stars
 (17 886 stars)
Métriques de merge PR
 (Merge moyen 12j 11h) (661 PRs mergées en 30 j)

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.

Guide contributeur