From 8d065d767d945f1c43a9267690fd0861cea94b5b Mon Sep 17 00:00:00 2001 From: Octavia Togami Date: Mon, 24 Feb 2020 00:39:22 -0800 Subject: [PATCH] Fix bug introduced in return-handling refactor (cherry picked from commit f8be17d362e51ff9f56f3e76e6776f9012c168f5) --- .../internal/expression/invoke/CompilingVisitor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/invoke/CompilingVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/invoke/CompilingVisitor.java index ae2b153ba..72e5f6f64 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/invoke/CompilingVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/invoke/CompilingVisitor.java @@ -678,10 +678,13 @@ class CompilingVisitor extends ExpressionBaseVisitor { // MH:oldResult,result = (ExecutionData)Double // Execute `oldResult` but ignore its return value, then execute result and return that. - // If `oldResult` (the old value) is `defaultResult`, it's bogus, so just skip it + // If either result is `defaultResult`, it's bogus, so just skip it if (oldResult == DEFAULT_RESULT) { return result; } + if (result == DEFAULT_RESULT) { + return oldResult; + } // Add a dummy Double parameter to the end // MH:dummyDouble = (ExecutionData, Double)Double MethodHandle dummyDouble = MethodHandles.dropArguments(