Commit bc061ad
fix(#555): C backend fails loud on handle/resume instead of dropping arms
The C backend's ExprHandle arm compiled the body and discarded every
handler arm (`handle 41 { return(v) => v+1 }` emitted 41, not 42), and
ExprResume was a silent argument passthrough — the same silent wrong-value
miscompile #555 fixed in the WASM/WasmGC/Deno-ESM/JS-text backends. Now
failwith (caught by codegen_c → Error), matching the loud-fail policy; use
the interpreter for algebraic effects.
Adds an E2E loud-fail test for the C backend. Documents (in the handler-
fence test block) that the Lean/Why3 text backends are experimental stubs
which drop `return` statements wholesale — a broader incompleteness than
#555, flagged separately rather than given a misleading handle-only fence.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent aa1b73f commit bc061ad
2 files changed
Lines changed: 46 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
243 | | - | |
244 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
245 | 261 | | |
246 | 262 | | |
247 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2281 | 2281 | | |
2282 | 2282 | | |
2283 | 2283 | | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
2284 | 2310 | | |
2285 | 2311 | | |
2286 | 2312 | | |
2287 | 2313 | | |
2288 | 2314 | | |
| 2315 | + | |
2289 | 2316 | | |
2290 | 2317 | | |
2291 | 2318 | | |
| |||
0 commit comments