Skip to content
Snippets Groups Projects
Commit 8d1b2ab1 authored by Basile Desloges's avatar Basile Desloges
Browse files

Merge branch 'bugfix/basile/eacsl-reserved-axiomatic-name' into 'master'

[eacsl] Fix crash when creating an axiomatic with an existing name

Closes e-acsl#161

See merge request frama-c/frama-c!3478
parents 33956f4f 8762c595
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
Plugin E-ACSL <next-release> Plugin E-ACSL <next-release>
############################ ############################
-* E-ACSL [2021-12-03] Fix crash when creating an axiomatic with an
existing name in E-ACSL's RTL (frama-c/e-acsl#161).
-* E-ACSL [2021-12-01] Fix crash when binding a lambda-abstraction to a -* E-ACSL [2021-12-01] Fix crash when binding a lambda-abstraction to a
local variable (frama-c/e-acsl#189). local variable (frama-c/e-acsl#189).
-* e-acsl-gcc [2021-11-30] Fix e-acsl-gcc.sh bash autocompletion script and -* e-acsl-gcc [2021-11-30] Fix e-acsl-gcc.sh bash autocompletion script and
......
...@@ -232,7 +232,7 @@ let lookup_rtl_globals rtl_ast = ...@@ -232,7 +232,7 @@ let lookup_rtl_globals rtl_ast =
Assocs.add_kf g kf Assocs.add_kf g kf
in in
do_it ~add ~assoc (fun _ -> Globals.Functions.mem_name vi.vname) acc l g do_it ~add ~assoc (fun _ -> Globals.Functions.mem_name vi.vname) acc l g
| GAnnot (Daxiomatic (name, galist, _, _), _) as g :: l -> | GAnnot (Daxiomatic (name, galist, _, _) as ga, _) as g :: l ->
(* processing axiomatics *) (* processing axiomatics *)
let fun_or_preds = let fun_or_preds =
(* extract the functions and predicates from the axiomatic *) (* extract the functions and predicates from the axiomatic *)
...@@ -264,19 +264,43 @@ let lookup_rtl_globals rtl_ast = ...@@ -264,19 +264,43 @@ let lookup_rtl_globals rtl_ast =
all its functions and predicates are in the user's project. If only all its functions and predicates are in the user's project. If only
some of them are in it then it is an error, and if none of them are some of them are in it then it is an error, and if none of them are
then the axiomatic is not in the user's project. *) then the axiomatic is not in the user's project. *)
if exists && not forall then let in_user_prj =
Options.abort if exists && not forall then
"@[The following logic functions or predicates@ \ Options.abort
are in conflict with logic functions or predicates from the@ \ "@[The following logic functions or predicates@ \
axiomatic '%s' in the E-ACSL runtime library, please rename@ \ are in conflict with logic functions or predicates from the@ \
them:@ %a@]" axiomatic '%s' in the E-ACSL runtime library, please rename@ \
name them:@ %a@]"
(Pretty_utils.pp_list name
~sep:",@ " (Pretty_utils.pp_list
Printer.pp_logic_info) ~sep:",@ "
conflicting_lis Printer.pp_logic_info)
else conflicting_lis
forall else
forall
in
(* If the axiomatic is not "in the user's project", check if a different
axiomatic with the same name is in it. *)
if not in_user_prj then begin
let ip_from_ga = Property.ip_of_global_annotation ga in
let found =
try
Property_status.iter
(fun ppt ->
if List.exists (Property.equal ppt) ip_from_ga
then raise Exit);
false
with Exit ->
true
in
if found then
Options.abort
"@[The axiomatic '%s' is in conflict with an@ \
axiomatic with the same name in the E-ACSL runtime library,@ \
please rename it.@]"
name
end;
in_user_prj
in in
let assoc _g = let assoc _g =
List.iter List.iter
......
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