mirror of
https://github.com/gchq/CyberChef
synced 2025-12-05 23:53:27 +00:00
reset loop counter after last run
This commit is contained in:
@@ -64,6 +64,7 @@ class ConditionalJump extends Operation {
|
|||||||
jmpIndex = getLabelIndex(label, state);
|
jmpIndex = getLabelIndex(label, state);
|
||||||
|
|
||||||
if (state.numJumps >= maxJumps || jmpIndex === -1) {
|
if (state.numJumps >= maxJumps || jmpIndex === -1) {
|
||||||
|
state.numJumps = 0;
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,6 +75,9 @@ class ConditionalJump extends Operation {
|
|||||||
state.progress = jmpIndex;
|
state.progress = jmpIndex;
|
||||||
state.numJumps++;
|
state.numJumps++;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
state.numJumps = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ class Jump extends Operation {
|
|||||||
const jmpIndex = getLabelIndex(label, state);
|
const jmpIndex = getLabelIndex(label, state);
|
||||||
|
|
||||||
if (state.numJumps >= maxJumps || jmpIndex === -1) {
|
if (state.numJumps >= maxJumps || jmpIndex === -1) {
|
||||||
|
state.numJumps = 0;
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user