Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lustre-v6
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
verimag
synchrone
lustre-v6
Commits
051d1a17
Commit
051d1a17
authored
4 years ago
by
erwan
Browse files
Options
Downloads
Patches
Plain Diff
Fix: lv6 -exec was raising a spurious runtime error
parent
fe2e657b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/main.ml
+8
-5
8 additions, 5 deletions
bin/main.ml
lib/lv6errors.ml
+9
-1
9 additions, 1 deletion
lib/lv6errors.ml
lib/socExecValue.ml
+11
-5
11 additions, 5 deletions
lib/socExecValue.ml
with
28 additions
and
11 deletions
bin/main.ml
+
8
−
5
View file @
051d1a17
(* Time-stamp: <modified the 1
2
/03/202
0
(at 1
1:45
) by Erwan Jahier> *)
(* Time-stamp: <modified the 1
5
/03/202
1
(at 1
2:28
) by Erwan Jahier> *)
open
AstV6
open
Lxm
...
...
@@ -324,12 +324,12 @@ could try one the options: -2c, -2c-exec, -exec, -ec, -lic, or -h for more optio
|
Parse_error
->
print_compile_error
(
Lxm
.
last_made
()
)
"Syntax error"
;
my_exit
opt
1
|
Unknown_var
(
lxm
,
id
)
->
print_
compil
e_error
lxm
(
"unknown variable ("
^
(
Lv6Id
.
to_string
id
)
^
")"
);
print_
runtim
e_error
lxm
(
"unknown variable ("
^
(
Lv6Id
.
to_string
id
)
^
")"
);
my_exit
opt
1
|
Unknown_constant
(
lxm
,
str
)
->
print_
compil
e_error
lxm
(
"unknown constant ("
^
str
^
")"
);
print_
runtim
e_error
lxm
(
"unknown constant ("
^
str
^
")"
);
my_exit
opt
1
|
Compile_error
(
lxm
,
msg
)
->
print_
compil
e_error
lxm
msg
;
my_exit
opt
1
|
Compile_error
(
lxm
,
msg
)
->
print_
runtim
e_error
lxm
msg
;
my_exit
opt
1
|
L2lCheckLoops
.
Error
(
lxm
,
msg
,
lic_prg
)
->
(* Sometime it helps to see the current state of the faulty program *)
LicPrg
.
to_file
opt
lic_prg
main_node
;
...
...
@@ -337,7 +337,10 @@ could try one the options: -2c, -2c-exec, -exec, -ec, -lic, or -h for more optio
print_compile_error
lxm
msg
;
my_exit
opt
1
|
SocExec
.
AssertViolation
lxm
->
print_compile_error
lxm
"An assertion is violated in the Lustre program"
;
print_runtime_error
lxm
"An assertion is violated in the Lustre program"
;
my_exit
opt
1
|
Failure
msg
->
Printf
.
eprintf
"
\n
Runtime Error: %s
\n
"
msg
;
my_exit
opt
1
|
Assert_failure
(
file
,
line
,
col
)
->
prerr_string
(
...
...
This diff is collapsed.
Click to expand it.
lib/lv6errors.ml
+
9
−
1
View file @
051d1a17
(* Time-stamp: <modified the
29
/0
8
/201
9
(at 1
4:17
) by Erwan Jahier> *)
(* Time-stamp: <modified the
15
/0
3
/20
2
1 (at 1
2:22
) by Erwan Jahier> *)
(** *)
...
...
@@ -105,6 +105,9 @@ Formatage standard des erreurs de compil
let
compile_error_string
lxm
msg
=
(
Printf
.
sprintf
"
\n
Error: %s:
\n
Error: %s
\n
"
(
Lxm
.
details
lxm
)
msg
)
let
runtime_error_string
lxm
msg
=
(
Printf
.
sprintf
"
\n
Runtime Error: %s:
\n
Error: %s
\n
"
(
Lxm
.
details
lxm
)
msg
)
(** ---------------------------------------------------------------------
Message d'erreur (associé à un lexeme) sur stderr
...
...
@@ -114,6 +117,11 @@ let print_compile_error lxm msg = (
flush
stderr
)
let
print_runtime_error
lxm
msg
=
(
Printf
.
eprintf
"%s
\n
"
(
compile_error_string
lxm
msg
);
flush
stderr
)
(** ---------------------------------------------------------------------
Warning (associé à un lexeme) sur stderr
----------------------------------------------------------------------*)
...
...
This diff is collapsed.
Click to expand it.
lib/socExecValue.ml
+
11
−
5
View file @
051d1a17
(* Time-stamp: <modified the
06
/03/202
0
(at 1
3:30
) by Erwan Jahier> *)
(* Time-stamp: <modified the
15
/03/202
1
(at 1
5:44
) by Erwan Jahier> *)
let
dbg
=
(
Lv6Verbose
.
get_flag
"exec"
)
...
...
@@ -285,11 +285,17 @@ let rec (get_value : ctx -> var_expr -> Data.v) =
|
Field
(
ve
,
fn
,_
t
)
->
let
s
=
get_value
ctx
ve
in
(
match
s
with
|
S
fl
->
(
try
List
.
assoc
fn
fl
with
Not_found
->
assert
false
(* should not occur *)
|
U
->
U
|
S
fl
->
(
try
List
.
assoc
fn
fl
with
Not_found
->
assert
false
(* should not occur *)
)
|
_
->
assert
false
(* should not occur *)
|
_
->
let
msg
=
Printf
.
sprintf
"'%s' is not a struct
\n
"
(
SocUtils
.
string_of_filter
ve
)
in
failwith
msg
(* assert false (* should not occur *) *)
)
|
Index
(
ve
,
i
,_
vt
)
->
(
let
a
=
get_value
ctx
ve
in
...
...
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