Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Interpolated var access is sometimes -1

オープン
#15 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp
領域
game-dev

調査の方向性

Start in InterpolatedVar.cs, reading WrapRange and the indexer that adds firstElement before wrapping. Trace how an index that passes IsIdxValid can become -1, and identify the caller or input that triggers it. Done means the cause is understood and corrected so valid accesses do not rely on modulo to mask the invalid index.

索引モデルが issue の本文から書いたものです。

説明

Bug Help Wanted

In InterpolatedVar.cs, changed by 1348c82ed9ef4d6112115fe5614e8cd01c140a1c:

private int WrapRange(int i) {
	return MathLib.Modulo(i, maxElement); // TODO: Why does -1 get passed here sometimes. We shouldn't have to change this to accomodate.
}

This should actually be

return (i >= maxElement) ? (i - maxElement) : i;

But for some reason, i coming in can sometimes be -1 when coming from here:

	public ref T this[int i] {
		get {
			Assert(IsIdxValid(i));
			i += firstElement;
			i = WrapRange(i);
			return ref elements![i];
		}
	}

There is a check for this (IsIdxValid), but it's just an assert. This must be some bug in my implementation I would imagine, but further research is needed. For now, the modulo works with an occasional hiccup.

主要言語
C#
スター
104
フォーク
9
平均マージ
6時間 45分
マージ済み PR(30日)
118

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SourceDotNET/Source.NET のほかの issue

SourceDotNET/Source.NET の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。