Comments (1)
This is exposed by - not caused by - a recent commit #2016
Underlying defective change was introduced via commit b4875fc made for #1517 and merged on 2024-01-29 at 09:51:08
Basically, this commit changed the method org.eclipse.jdt.internal.compiler.ast.TypePattern.bindingsWhenTrue()
from being:
@Override
public LocalVariableBinding[] bindingsWhenTrue() {
return this.local != null && this.local.binding != null ?
new LocalVariableBinding[] { this.local.binding } : NO_VARIABLES;
}
to
@Override
public LocalVariableBinding[] bindingsWhenTrue() {
return this.local != null && this.local.binding != null && !this.local.isUnnamed(this.local.binding.declaringScope) ?
new LocalVariableBinding[] { this.local.binding } : NO_VARIABLES;
}
This is incorrect and was masked so far by the fact that we wouldn't even deconstruct the record pattern in this scenario till
#1517
Now since the unnamed pattern binding is not returned as being live, its live range in the region corresponding to "thunk" emitted by org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression.generateCode(BlockScope, CodeStream, boolean) is not closed by this chunk of code:
thereby leaving the stackmap inconsistent.
Interestingly, I had already found and fixed this problem in my private branch where I am accumulative fixes to be merged in after 4.32 master opens:
from eclipse.jdt.core.
Related Issues (20)
- [Patterns][unnamed] Support for identifier '_' for old compile source/target versions HOT 2
- [Patterns][internal] toString() output of AST nodes shows up with modifier sealed for pattern variables
- [Switch][Pattern] Withdraw the internal AST APIs Pattern.suspendVariables & Pattern.resumeVariables
- [Patterns][Unnamed] Wasteful allocation and assignment into unnamed pattern variables.
- [Patterns][internal] High degree of code duplication in instanceof pattern code generation
- CommentRecorderParser sometimes generates ranges that miss Javadoc HOT 2
- Type signatures returned through bindings don't match signatures returned through codeSelect
- Pattern matching instanceof expression with bit-wise and doesn't report a parser error but doesn HOT 1
- Pattern matching instanceof expression with bit-wise-and doesn't report a parser error but doesn't recognize pattern variable HOT 2
- ResourceLeakTests & ResourceLeakAnnotatedTests fail in some compliance levels when run locally via RunJDTCoreTests HOT 4
- [Patterns][internal] It doesn't make sense for org.eclipse.jdt.internal.compiler.ast.RecordPattern to extend TypePattern
- [Patterns][smell] {TypePattern/RecordPattern/GuardedPattern}.resolveType should not be reentered HOT 1
- [Pattern] Grammar file references impossible and nop reduce action methods
- ASTParser cannot keep elements/nodes after a lambda expression (without a block)
- org.eclipse.jdt.core.dom.MethodBinding$LambdaMethod doesn't resolve to a org.eclipse.jdt.internal.core.LambdaMethod (err to ResolvedSourceMethod)
- Formater: Blank lines and highlighting breaks when top level class is record with two or more fields HOT 3
- ASTParser.createAST silently stop in the middle of a batch of compilation units HOT 7
- [Switch][Patterns] ECJ incorrectly holds a record pattern "guarded by when true" as being unconditional for the switch expression type
- [memory] deduplicate ResolvedBinaryType.uniqueKey
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eclipse.jdt.core.