diff options
| author | Robert Norton | 2019-06-19 17:04:31 +0100 |
|---|---|---|
| committer | Robert Norton | 2019-06-19 17:04:31 +0100 |
| commit | 414b8f4e103bd6112001fe140cfb3b32c97e8bb5 (patch) | |
| tree | 7e56df2d5776688df2e8cb5721e1d0906ed3d2e1 /src | |
| parent | b024aa981ddc3411d9b9d22e169a9d9a924f7124 (diff) | |
Make C emulator exit with failure for uncaught exception. Make special case for 'exception.sail' test that deliberately exits with uncaught exception.
Diffstat (limited to 'src')
| -rw-r--r-- | src/jib/c_backend.ml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/jib/c_backend.ml b/src/jib/c_backend.ml index 242f31b2..c06a5494 100644 --- a/src/jib/c_backend.ml +++ b/src/jib/c_backend.ml @@ -2186,7 +2186,7 @@ let compile_ast env output_chan c_includes ast = " CREATE(zexception)(current_exception);" ], [ " KILL(zexception)(current_exception);"; " free(current_exception);"; - " if (have_exception) fprintf(stderr, \"Exiting due to uncaught exception\\n\");" ]) + " if (have_exception) {fprintf(stderr, \"Exiting due to uncaught exception\\n\"); exit(EXIT_FAILURE);}" ]) in let letbind_initializers = @@ -2231,9 +2231,9 @@ let compile_ast env output_chan c_includes ast = @ letbind_finalizers @ List.concat (List.map (fun r -> snd (register_init_clear r)) regs) @ finish cdefs + @ [ " cleanup_rts();" ] @ snd exn_boilerplate - @ [ " cleanup_rts();"; - "}" ] )) + @ [ "}" ] )) in let model_default_main = separate hardline (List.map string |
