Numeric arguments parsed with toInt() silently become 0, and the documented EXPECT … AT (r,c) form never matches

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

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

評価

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

調査の方向性

Start with the argument parsing code in src/script_parser.cpp, especially the listed toInt() call sites and the EXPECT coordinate handling. Compare the documented forms and reproduction examples in the issue with how each statement parses its arguments. Done means invalid numbers produce parse errors, documented variables work where expected, and EXPECT accepts parenthesised coordinates consistently.

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

説明

bug
Summary

Numeric statement arguments are read with QString::toInt() without checking the result, and variables are not interpolated there. Non-numeric or overflowing values become 0; decimals are truncated.

Location
  • File(s): src/script_parser.cpp
  • Line(s) / function(s): L280–L296, L428–L432, L444–L448, L508–L518, L533, L567, L679–L681
Category

functional

Severity

medium

Loops and waits silently do nothing, and EXPECT with parenthesised coordinates always times out.

Reproduction / Evidence

Reproducible at runtime:

  • ADD $X $N adds 0; REPEAT $N runs 0 times; EXTRACT … FROM $N 1 LENGTH $N returns "".
  • SET $P 1.5 stores 1; WAIT 2.5 waits 2 ms.
  • GLOBAL EXPECT_TIMEOUT 99999999999 becomes 0 → next EXPECT times out at once.
  • EXPECT CURSOR AT (1,1) and EXPECT TEXT "ABC" AT (1,1) always time out while AT 1 1 works (MOVE accepts the parenthesised form).
  • README examples EXTRACT $line LINE $row and TYPE $user do not work.
Expected Behavior

Invalid numbers are parse errors; variables are allowed where documented; (r,c) is accepted consistently.

Actual Behavior

Silent zeros.

Root Cause

toInt() without the ok flag; argument grammar not shared between statements.

主要言語
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 を短くまとめたダイジェスト。