dotnet/runtime

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

開放

#86,609 建立於 2023年5月22日

 (1 則留言) (1 個反應) (0 位負責人)C# (5,445 個分叉)batch import
area-CodeGen-coreclrhelp wanted

倉庫指標

星標
 (17,886 顆星)
PR 合併指標
 (平均合併 12天 11小時) (30 天內合併 661 個 PR)

描述

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.

貢獻者指南