From 6004a8694b854d881d72615de397d4f99c22eebb Mon Sep 17 00:00:00 2001 From: Srikanth Sankaran Date: Wed, 14 Feb 2024 07:24:42 +0530 Subject: [PATCH] - Just close live range allowing variable to stay visible --- .../jdt/internal/compiler/ast/InstanceOfExpression.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java index efad976f6b3..a2cc487417a 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java @@ -134,8 +134,8 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean codeStream.iconst_1(); codeStream.goto_(continueLabel); falseLabel.place(); - for (LocalVariableBinding patternVariableBinding : this.pattern.bindingsWhenTrue()) { - codeStream.removeVariable(patternVariableBinding); + for (LocalVariableBinding binding : this.pattern.bindingsWhenTrue()) { + binding.recordInitializationEndPC(codeStream.position); } codeStream.iconst_0(); continueLabel.place();