undefect. CWE-407 — 63 sites patched across 27 ecosystems

Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com

Patches, unit tests, benchmarks, whitepaper, and outreach briefs.
Public domain — no copyright claimed. Use freely.
This commit is contained in:
russell@unturf.com 2026-03-26 17:11:57 -04:00
commit 0a580b313d
70422 changed files with 17213626 additions and 0 deletions

View file

@ -0,0 +1,72 @@
/*
* @test /nodynamiccopyright/
* @bug 8373570
* @summary Javac stack overflow on method-local class with nested record referring to enclosing type
* @compile/fail/ref=NewLocalNotInInner.out -XDrawDiagnostics NewLocalNotInInner.java
*/
class NewLocalNotInInner {
void m() {
class Local {
static class Foo {
void m() {
new Local(); // error
}
}
}
}
void m_anon() {
class Local {
static class Foo {
void m() {
new Local() { }; // error
}
}
}
}
void m_record() {
class Local {
record Foo() {
void m() {
new Local(); // error
}
}
}
}
void m_intf() {
class Local {
interface Foo {
default void m() {
new Local(); // error
}
}
}
}
void sup() {
class Local {
static class Foo {
void m() {
class Sub extends Local { }; // error
new Sub();
}
}
}
}
static void staticLocal() {
class Local { }
new Local(); // ok
}
static void staticLocalFromAnon() {
class Local { }
new Object() {
Local local() {
return new Local(); // ok
}
};
}
}