WHILE with an empty body exits immediately even when the condition is true
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Read src/script_executor.cpp, especially the case NodeType::While block at lines 373–381 and the if (!node->children.isEmpty()) guard. Check how the loop is re-scheduled for a non-empty body; done means an empty-body WHILE re-evaluates its condition with the normal step delay until it becomes false.
Written by the indexing model from the issue text.
Description
Summary
When the body is empty, the While node does not re-queue itself, so WHILE cond / ENDWHILE (the natural busy-wait form) falls through after one evaluation.
Location
- File(s):
src/script_executor.cpp - Line(s) / function(s):
case NodeType::WhileL373–L381 (if (!node->children.isEmpty())guards the re-execution)
Category
functional
Severity
low
Reproduction / Evidence
Reproducible at runtime: WHILE $KEYBOARD_STATE == "LOCKED" / ENDWHILE continues at once while the state is still LOCKED.
Expected Behavior
The condition is re-evaluated (with the normal step delay) until false.
Actual Behavior
Single evaluation.
Root Cause
Re-execution is only scheduled when there are children to push.
- Dominant language
- C++
- Stars
- 1
- Forks
- 2
- Avg merge
- 1h 34m
- Merged PRs (30d)
- 7
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 5250ng/5250script
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
5250ng/5250script#30 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
5250ng/5250script#25 ·
-
aidByteToKeyword maps 0xF5 to PAGEUP and 0xF4 to PAGEDOWN, so recorded Page Down replays as Page UpOpenbug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
5250ng/5250script#20 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
5250ng/5250script#19 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
5250ng/5250script#18 ·
All issues in 5250ng/5250script
Similar issues
-
Invalid-MissingHash/Commit/NotAC
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
azerothcore/azerothcore-wotlk#28636 ·
Maintainers usually reply within 1 day
-
(S1 - Need confirmation)
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
CleverRaven/Cataclysm-DDA#89829 ·
Maintainers usually reply within 1 day
-
comp-documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ClickHouse/ClickHouse#136277 ·
Maintainers usually reply within 1 day
-
Flow Needs: Triage :mag:
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
react/react-native#60447 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day