From ccec3ef3e6d860df92daccd7e4d3016e6bd13f2b Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 8 Oct 2023 12:30:38 +0100 Subject: Push temporary when generating Patio code for switch --- ...esult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected | 1 + src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenSwitchTests]/[method:canGenerateCodeForSwitchWithSingleResult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenSwitchTests]/[method:canGenerateCodeForSwitchWithSingleResult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index a738ad65..af600e66 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenSwitchTests]/[method:canGenerateCodeForSwitchWithSingleResult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenSwitchTests]/[method:canGenerateCodeForSwitchWithSingleResult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -56,4 +56,5 @@ Instructions: ) Temporary stack: + * tmp__0 * other diff --git a/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java b/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java index 3510a249..66c2faf4 100644 --- a/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java +++ b/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java @@ -557,6 +557,8 @@ public class PatioCodeGen { switch_.source() )); + context = context.temporaryPush(target); + yield context; } -- cgit v1.2.3