diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-08-29 14:54:06 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-08-29 14:54:06 +0200 |
commit | 5cf814404cec9a8702e4bfa88e0f9176fa04ecfb (patch) | |
tree | fabd44046e3e5b9aaac7f33b9e4dddaa8d3f06e8 /driver/Interp.ml | |
parent | 3208e22ea89c459a5a7944ad8e82511d4a5328fa (diff) | |
parent | 477f73ef96d957de5a896a05175ceaab7e0dce03 (diff) | |
download | compcert-5cf814404cec9a8702e4bfa88e0f9176fa04ecfb.tar.gz compcert-5cf814404cec9a8702e4bfa88e0f9176fa04ecfb.zip |
Merge branch 'master' into advanced-diagnostics
Diffstat (limited to 'driver/Interp.ml')
-rw-r--r-- | driver/Interp.ml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/driver/Interp.ml b/driver/Interp.ml index 5c2158ae..f42bed32 100644 --- a/driver/Interp.ml +++ b/driver/Interp.ml @@ -387,10 +387,12 @@ let do_external_function id sg ge w args m = match camlstring_of_coqstring id, args with | "printf", Vptr(b, ofs) :: args' -> extract_string m b ofs >>= fun fmt -> - print_string (do_printf m fmt args'); + let fmt' = do_printf m fmt args' in + let len = coqint_of_camlint (Int32.of_int (String.length fmt')) in + print_string fmt'; flush stdout; convert_external_args ge args sg.sig_args >>= fun eargs -> - Some(((w, [Event_syscall(id, eargs, EVint Int.zero)]), Vint Int.zero), m) + Some(((w, [Event_syscall(id, eargs, EVint len)]), Vint len), m) | _ -> None |