Need to clear the state before analyzing the condition as the condition
may be re-evaluated after yielding.
This commit is contained in:
Thomas Weber committed 2025-09-22 18:40:34 -05:00
1 parent 41af457060
commit 44e2589e65
4 files changed
+73

No files matched your search

+5
View File
@@ -565,6 +565,11 @@ class IROptimizer {
this.addPossibleExitState(state);
break;
}
case StackOpcode.CONTROL_WAIT_UNTIL: {
modified = state.clear() || modified;
modified = this.analyzeInputs(inputs, state) || modified;
break;
}
case StackOpcode.PROCEDURE_CALL: {
modified = this.analyzeInputs(inputs, state) || modified;
modified = this.analyzeInputs(inputs.inputs, state) || modified;
Binary file not shown.
@@ -0,0 +1,34 @@
// TW Snapshot
// Input SHA-256: 2422e407892596fbf410e032196131f9bae718563fd80b1ff32cf972859c034b
// Sprite1 script
(function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage();
const b0 = runtime.getOpcodeFunction("looks_say");
const b1 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"];
return function* genXYZ () {
yield* executeInCompatibilityLayer({"MESSAGE":"plan 0",}, b0, false, false, "e", null);
startHats("event_whenbroadcastreceived", { BROADCAST_OPTION: "message1" });
b1.value = "bwah";
while (!(("" + b1.value).toLowerCase() === "bleh".toLowerCase())) {
yield;
}
yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "h", null);
retire(); return;
}; })
// Sprite1 script
(function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage();
const b0 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"];
return function* genXYZ () {
b0.value = (1 + 2);
thread.timer = timer();
var a0 = Math.max(0, 1000 * 0);
runtime.requestRedraw();
yield;
while (thread.timer.timeElapsed() < a0) {
yield;
}
thread.timer = null;
b0.value = "bleh";
retire(); return;
}; })
@@ -0,0 +1,34 @@
// TW Snapshot
// Input SHA-256: 2422e407892596fbf410e032196131f9bae718563fd80b1ff32cf972859c034b
// Sprite1 script
(function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage();
const b0 = runtime.getOpcodeFunction("looks_say");
const b1 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"];
return function* genXYZ () {
yield* executeInCompatibilityLayer({"MESSAGE":"plan 0",}, b0, false, false, "e", null);
startHats("event_whenbroadcastreceived", { BROADCAST_OPTION: "message1" });
b1.value = "bwah";
while (!(("" + b1.value).toLowerCase() === "bleh".toLowerCase())) {
yield;
}
yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "h", null);
retire(); return;
}; })
// Sprite1 script
(function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage();
const b0 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"];
return function* genXYZ () {
b0.value = (1 + 2);
thread.timer = timer();
var a0 = Math.max(0, 1000 * 0);
runtime.requestRedraw();
yield;
while (thread.timer.timeElapsed() < a0) {
yield;
}
thread.timer = null;
b0.value = "bleh";
retire(); return;
}; })