dotnet/runtime

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

オープン

#86,609 opened on 2023/05/22

 (1 件のコメント) (1 件のリアクション) (0 人の担当者)C# (5,445 件のフォーク)batch import
area-CodeGen-coreclrhelp wanted

Repository metrics

Stars
 (17,886 個のスター)
PR merge metrics
 (平均マージ 12d 11h) (30d で 661 merged PRs)

説明

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.

コントリビューターガイド