Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
62f77181
Commit
62f77181
authored
2 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[server] Catches exceptions when building a marker from a user-provided term.
parent
a20cbdc2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/server/kernel_ast.ml
+11
-7
11 additions, 7 deletions
src/plugins/server/kernel_ast.ml
with
11 additions
and
7 deletions
src/plugins/server/kernel_ast.ml
+
11
−
7
View file @
62f77181
...
...
@@ -847,22 +847,26 @@ end
module
MarkerTermOutput
=
Data
.
Joption
(
Marker
)
let
build_marker
=
Option
.
map
@@
fun
input
->
let
build_marker
input
=
let
env
=
let
open
Logic_typing
in
Lenv
.
empty
()
|>
append_pre_label
|>
append_init_label
|>
append_here_label
in
let
kf
=
Kernel_function
.
find_englobing_kf
input
.
atStmt
in
let
term
=
Logic_parse_string
.
term
~
env
kf
input
.
term
in
let
exp
=
Logic_to_c
.
term_to_exp
term
in
Printer_tag
.
PExp
(
Some
kf
,
Kstmt
input
.
atStmt
,
exp
)
try
let
kf
=
Kernel_function
.
find_englobing_kf
input
.
atStmt
in
let
term
=
Logic_parse_string
.
term
~
env
kf
input
.
term
in
let
exp
=
Logic_to_c
.
term_to_exp
term
in
Some
(
Printer_tag
.
PExp
(
Some
kf
,
Kstmt
input
.
atStmt
,
exp
))
with
Not_found
|
Logic_parse_string
.
Error
_
|
Logic_parse_string
.
Unbound
_
|
Logic_to_c
.
No_conversion
->
None
(* TODO: return an error message. *)
let
descr
=
"Build a marker from an ACSL term."
let
()
=
Request
.
register
~
package
~
kind
:
`GET
~
name
:
"markerFromTerm"
~
descr
:
(
Markdown
.
plain
descr
)
~
input
:
(
module
MarkerTermInput
)
~
output
:
(
module
MarkerTermOutput
)
build_marker
(
fun
input
->
Option
.
bind
input
build_marker
)
(**************************************************************************)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment