Fix FP for always-locked fields

This commit is contained in:
Owen Mansel-Chan
2025-03-13 15:03:32 +00:00
parent dc2cbf7402
commit a8e993c942
2 changed files with 5 additions and 3 deletions

View File

@@ -68,7 +68,9 @@ predicate alwaysLocked(Field f) {
or
exists(RefType thisType |
forex(VarAccess access |
access = f.getAnAccess() and not access.getEnclosingCallable() instanceof InitializerMethod
access = f.getAnAccess() and
not access.getEnclosingCallable() instanceof Constructor and
not access.getEnclosingCallable() instanceof InitializerMethod
|
locallySynchronizedOnThis(access, thisType)
)