Skip to content

fix: v0.10.1 P0 declaration, constructor boundary, and retarget soundness - #37

Merged
VillanCh merged 2 commits into
mainfrom
fix/v0.10.1-p0-hardening
Nov 21, 2026
Merged

VillanCh merged 2 commits into
mainfrom
fix/v0.10.1-p0-hardening

Conversation

@VillanCh

Copy link
Copy Markdown
Contributor

Summary

This release-hardening patch release (v0.10.1) resolves all P0-level unsoundness and uncompilability bugs discovered during the full 1,298-class audit of testdata/external/bundletool-install-time.aab on top of v0.10.0:

  1. SourceAssignmentForward declaration & rewrite unwrapping (classparser/decompiler/rewriter)
    • Added unwrapAssignStatement / rewrapAssignStatement and wired SourceAssignmentForward unwrapping across rewrite_var.go, declaration_dominance.go, missing_local_declaration.go, declaration_barriers.go, dispatch_local_hoist.go, widen_structured.go, and widen_instanceof.go.
    • Eliminates DUPLICATE_LOCAL and UNDECLARED_VAR failures caused when declaration placement, dominance, barrier, and widening passes skipped CustomStatement-wrapped source assignments.
  2. Constructor IsThisAlias boundary & post-super field-store gating (classparser/constructor_source_boundary.go, classparser/constructor_retain_prefix.go)
    • Recognized ref.IsThisAlias in both Precision and RetainUnprovedSource modes when JDEC_THIS_ALIAS_SUPER_OFF is unset (failing closed in Precision mode instead of emitting misplaced super/this calls after alias setup).
    • Folded dead this-alias receiver copies (foldRetainedConstructorPrefix) and guarded pure post-super this.<field> = <pure_rhs> stores via canCommitWithRemainingThisFieldStores + values.InspectAccess side-effect/aliasing checks before hoisting super/this(...) first.
  3. retargetAssignToTypedSibling declaration & forward-scope guard (classparser/hardjar_shape.go)
    • Guarded against retargeting typed declaration statements (var20 = null; -> Object var20 = null;) and restricted declared-type lookup to text strictly preceding the assignment (member[:relIdent]), updating only the targeted occurrence.
  4. Identity-based if/switch/sync/parallelArm hoist unification (classparser/decompiler/rewriter/rewrite_var.go)
    • Added unifyHoistedAssignTargets, replaceVarInStatements, and findAssignReadAfterByIdentity (kill-switch JDEC_IF_HOIST_IDENTITY_OFF=1).
    • Updated ifHoistDeclarations, switchHoistDeclarations, syncHoistDeclarations, and parallelArmDeclHoist to unify hoisted declaration identities and rewrite in-body reads/writes as well as trailing statements, preventing resolveLocalNameCollisions or sourceWithoutDeadLocalStores from stranding or dropping live locals.
  5. Version bump & sealed CI inventory
    • Bumped javajive.Version to "0.10.1" (javajive.go).
    • Added unit/regression tests in classparser/decompiler/rewriter/source_assignment_forward_test.go, classparser/constructor_retain_prefix_test.go, and classparser/hardjar_shape_test.go, and updated tools/requiredci/main.go.

Verification

  • bundletool-install-time.aab (--best-effort, 1,298 .java files, status=complete, 0 warnings): scope-aware P0 audit reports CTOR_SUPER_OR_THIS_NOT_FIRST=0, DUPLICATE_LOCAL=0, UNDECLARED_VAR_LINES=0 DISTINCT=0, and 12-category deep scan ALL CLEAN (0 hits).
  • Local gates passed:
    • go run ./tools/requiredci -check
    • go run ./tools/requiredci -run contract
    • go run ./tools/requiredci -run algorithm
    • go run ./tools/requiredci -run dex
    • go run ./tools/requiredci -run corpus
    • go test -tags javajive_full_jdk ./classparser -run "^(TestJDKCompressedCatalogMatchesSource|TestJDKCompressedConstructorCodeMatchesSource|TestAdversarialPlatformConstructorCodeIdentityAndEffectProof|TestAdversarialPlatformIndexedDeclarationsRetainOriginalBytecode)$"
    • go vet ./...
    • CGO_ENABLED=0 go build ./... & CGO_ENABLED=0 go build -tags javajive_full_jdk ./...
    • JAVAJIVE_EXTERNAL_EVAL=1 go test -v -count=1 ./test/external (TestExternalJModAndJImage skipped without JAVAJIVE_JIMAGE_INTEGRATION=1 / JDK)
    • go test . ./cmd/javajive & go run ./cmd/javajive version (javajive 0.10.1)
    • git diff --check

@VillanCh VillanCh closed this Nov 21, 2026
@VillanCh VillanCh reopened this Nov 21, 2026
@VillanCh
VillanCh merged commit fe2acc4 into main Nov 21, 2026
5 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant