Skip to content

fix: decide dead branches through a nested object only when its calls and reads cannot change it - #451

Merged
Sorte1 merged 4 commits into
mainfrom
fix/ox2-e
Nov 19, 2026
Merged

Sorte1 merged 4 commits into
mainfrom
fix/ox2-e

Conversation

@Sorte1

@Sorte1 Sorte1 commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Fixes F1 to F3 from the OX-R1 review (#439's nested-object decision in dead.rs, wrong output in both lanes).

A nested const object now decides a dead branch only in these cases:

  • Every entry is a plain key: value with a static identifier or string key, and none is __proto__ in any spelling. Getters, methods, spread and computed keys are refused, as before.
  • Nothing in the literal uses this, super, arguments or eval, so a call through the object cannot write to it or hand it back. This covers arrows inside methods and o.self().k = ....
  • Every read of the object names an own key. Under --unsafe a read may also name a key that Object.prototype does not define, since built-ins are assumed unpatched. A dead-code copy reads A.fromCharCode, and refusing that read broke rnd013-n1--objects. o.valueOf().k = ... and o.__defineGetter__(...) are refused in both lanes, and so is a patched Object.prototype method in the default lane.
  • Only a plain function is folded. An async or generator property is not.

F6, the timer note's premise in the README, is already covered on main by #446 and #448, so this PR leaves it alone.

Rows in obfuscator_sweep_rows.rs cover every repro and variant from the review, checked against node in both lanes, plus one row showing that a plain nested object still decides.

Full sweep (3,465 cases, before the rebase): every verdict in both lanes is the same as main @16463ffa, with no pass to fail and no kept to fail. Krunker samples are byte-identical to main in both lanes. Obfuscator BASELINE drift tests pass. Wasm is 16,063,946 bytes, under the current cap.

@Sorte1
Sorte1 merged commit 0680009 into main Nov 19, 2026
9 checks passed
@Sorte1
Sorte1 deleted the fix/ox2-e branch November 19, 2026 08:28

This branch was successfully deployed

1 active deployment
preview — c6984b0f Deployed Nov 19, 2026 by Sorte1 via deploy #1301
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