Commit f10b062
Recognize a jump to an exit without going through make_key
compile_orhandlers asked whether the term it had built was a jump to the exit
it was about to wrap a catch around, and asked by calling make_key - which
builds a canonical form for comparison - then matching the result and binding
the raise's arguments from it. So a fragment of a key reached generated code,
and keys are the one place in Lambda built without the constructors: make_key
rebuilds raw, so a term it produced was not normalized.
The substitution was load-bearing rather than incidental. The term may be
[let x = e in exit j x], and it is discarded once recognized, so taking the
arguments as written would leave x unbound. make_key happened to substitute
alias bindings while canonicalizing, which is what made the arguments safe.
as_exit_call does that deliberately: peel alias bindings, substitute them into
the arguments, and report the exit. raw_action then has no callers - it was
the only consumer of make_key whose result was emitted rather than compared.
Generated JavaScript is unchanged.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W8g8qwBARAcvW9MyuKQq8H1 parent ef1b4af commit f10b062
1 file changed
Lines changed: 21 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | 497 | | |
503 | 498 | | |
504 | 499 | | |
| |||
2315 | 2310 | | |
2316 | 2311 | | |
2317 | 2312 | | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
2318 | 2331 | | |
2319 | 2332 | | |
2320 | 2333 | | |
2321 | 2334 | | |
2322 | 2335 | | |
2323 | 2336 | | |
2324 | 2337 | | |
2325 | | - | |
2326 | | - | |
| 2338 | + | |
| 2339 | + | |
2327 | 2340 | | |
2328 | 2341 | | |
2329 | 2342 | | |
2330 | 2343 | | |
2331 | | - | |
| 2344 | + | |
2332 | 2345 | | |
2333 | 2346 | | |
2334 | 2347 | | |
| |||
0 commit comments