Numeric comparison and arithmetic are 32-bit int only and overflow

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

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

評価

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

調査の方向性

Start in src/script_executor.cpp at the comparison code around L666–L668 and the INC/DEC/ADD code around L337, L344, and L351; trace how each converts numeric values. Reproduce the reported cases and check the project’s existing tests before choosing how to represent and compare numbers. Done means decimal comparison works and the reported overflow cases no longer produce incorrect results or undefined behavior.

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

説明

bug
Summary

The docs state numeric values compare numerically, but comparison and INC/DEC/ADD use toInt(): decimals and values above INT_MAX fall back to string comparison, and INC on INT_MAX overflows (signed-overflow UB).

Location
  • File(s): src/script_executor.cpp
  • Line(s) / function(s): comparison L666–L668; INC/DEC/ADD L337, L344, L351
Category

functional

Severity

low

Reproduction / Evidence

Reproducible at runtime: "9.5" < 10 is false; INC on 2147483647 gives -2147483648; SET $M 3000000000 / INC $M gives 1.

Expected Behavior

64-bit or decimal arithmetic with overflow detection; numeric comparison for decimals.

Actual Behavior

As above.

Root Cause

int conversions throughout.

主要言語
C++
スター
1
フォーク
2
平均マージ
1時間 34分
マージ済み PR(30日)
7

環境構築

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

はじめの一歩

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

5250ng/5250script のほかの issue

5250ng/5250script の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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