Skip to content
Snippets Groups Projects
Commit 4f07a48b authored by Andre Maroneze's avatar Andre Maroneze Committed by David Bühler
Browse files

[Kernel] avoid crash in unroll pragma with large integer

parent 7c3b535a
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,14 @@ let update_info global_find_init emitter info spec = ...@@ -51,7 +51,14 @@ let update_info global_find_init emitter info spec =
in in
let i = Logic_utils.constFoldTermToInt t in let i = Logic_utils.constFoldTermToInt t in
match i with match i with
| Some i -> { info with unroll_number = Some (Integer.to_int i) } | Some i ->
begin
match Integer.to_int_opt i with
| Some _ as unroll_number -> { info with unroll_number }
| None -> Kernel.abort ~current:true
"count too large in unrolling directive: %a"
(Integer.pretty ~hexa:false) i
end
| None -> | None ->
Kernel.warning ~once:true ~current:true Kernel.warning ~once:true ~current:true
"ignoring unrolling directive (not an understood constant \ "ignoring unrolling directive (not an understood constant \
......
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