)]}'
{
  "commit": "974221b1ef82f6393d004e5da6116f2ad3e44005",
  "tree": "4087fd2f78d14f2a68b32513fcc7d77e0f137b86",
  "parents": [
    "4e145b34f8ebe2ae8931af3f36d85601960d0e46"
  ],
  "author": {
    "name": "aizu-m",
    "email": "aizumusheer2@gmail.com",
    "time": "Sun Aug 30 21:09:44 2026"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Sun Aug 30 21:09:44 2026"
  },
  "message": "Reject delegate depth overflow in TypeChecker::OnDelegate (#2841)\n\nwat2wasm and wasm-validate on a try...delegate with depth 0xffffffff:\n\n    $ wat2wasm bad.wat -o bad.wasm     # accepted\n    $ wasm-validate bad.wasm ; echo $? # 0\n\nSpotted wasm-validate passing a module that wasm-interp then hangs on.\n`TypeChecker::OnDelegate` resolves the delegate target with\n`GetLabel(depth + 1)`, as the depth counts from after the try being\nclosed. `depth` is a u32 taken straight from the module. For `depth \u003d\u003d\n0xffffffff` the `depth + 1` wraps to 0, and `GetLabel(0)` always\nsucceeds, so the bounds check never fires. `delegate 0xfffffffe` is\nstill rejected (\"invalid depth: 4294967295 (max 2)\"); only the exact\nwrap slips through.\n\nDownstream the interp builds the handler from `GetNearestTryLabel(depth\n+ 1)`, i.e. `GetNearestTryLabel(0)`, which returns the try being closed.\nThe try delegates to itself, and `Thread::DoThrow` loops on the\nself-referential handler.\n\nRejecting `depth \u003d\u003d kInvalidIndex` before the add closes both the wat\nand binary paths. Every in-range delegate is untouched.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ada0ab03881010704fe94b77f1a02dcbf59356ff",
      "old_mode": 33188,
      "old_path": "src/type-checker.cc",
      "new_id": "8bc8e631ec1ac7635e375d48e7337b28b2fc54ae",
      "new_mode": 33188,
      "new_path": "src/type-checker.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "eca61e36d442f8934f880fbd5440199ab07ed70d",
      "new_mode": 33188,
      "new_path": "test/typecheck/bad-delegate-depth-overflow.txt"
    }
  ]
}
