Skip to content
Snippets Groups Projects
Commit a80023cb authored by Andre Maroneze's avatar Andre Maroneze
Browse files

Merge branch 'fix/ocaml408/unmarshal' into 'master'

[Unmarshal] fix for OCaml 4.08

Closes #665

See merge request frama-c/frama-c!2295
parents 1755ced8 e885d10c
No related branches found
No related tags found
No related merge requests found
...@@ -472,13 +472,25 @@ let input_val ch t = ...@@ -472,13 +472,25 @@ let input_val ch t =
let clos = intern_rec [] t in let clos = intern_rec [] t in
return stk (Obj.add_offset (Obj.repr clos) ofs) return stk (Obj.add_offset (Obj.repr clos) ofs)
| 0x12 (* CODE_CUSTOM *) -> | 0x12 | 0x19 (* CODE_CUSTOM (deprecated) or CODE_CUSTOM_FIXED *) ->
let id = read_customident ch in let id = read_customident ch in
let v = read_custom ch id in let v = read_custom ch id in
let dest = !ctr in let dest = !ctr in
ctr := dest + 1; ctr := dest + 1;
return_block stk t v dest return_block stk t v dest
| 0x18 (* CODE_CUSTOM_LEN *) ->
let id = read_customident ch in
(* Note: CODE_CUSTOM_FIXED and CODE_CUSTOM_LEN has the length of the
payload statically computable, but contrary to the C code,
we don't check that the size matches. *)
let _sz_32 = read32u ch in
let _sz_64 = read64u ch in
let v = read_custom ch id in
let dest = !ctr in
ctr := dest + 1;
return_block stk t v dest
| _ when code >= 0x80 (* PREFIX_SMALL_BLOCK *) -> | _ when code >= 0x80 (* PREFIX_SMALL_BLOCK *) ->
let tag = code land 0xF in let tag = code land 0xF in
let size = (code lsr 4) land 0x7 in let size = (code lsr 4) land 0x7 in
...@@ -491,7 +503,7 @@ let input_val ch t = ...@@ -491,7 +503,7 @@ let input_val ch t =
read_string stk t len read_string stk t len
| _ -> | _ ->
ill_formed (Printf.sprintf "code %x" code) ill_formed (Printf.sprintf "code 0x%x" code)
in in
match t with match t with
| Dynamic f -> | Dynamic f ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment