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
01ab2ccb
Commit
01ab2ccb
authored
16 years ago
by
Erwan Jahier
Browse files
Options
Downloads
Patches
Plain Diff
Fix a bug in the -esa mode: all program using constants were crashing.
parent
3fa6378d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/structArrayExpand.ml
+21
-46
21 additions, 46 deletions
src/structArrayExpand.ml
src/test/Makefile
+1
-1
1 addition, 1 deletion
src/test/Makefile
with
22 additions
and
47 deletions
src/structArrayExpand.ml
+
21
−
46
View file @
01ab2ccb
(** Time-stamp: <modified the 0
3
/02/2009 (at 1
1:1
4) by Erwan Jahier> *)
(** Time-stamp: <modified the 0
5
/02/2009 (at 1
6:2
4) by Erwan Jahier> *)
(* Replace structures and arrays by as many variables as necessary.
Since structures can be recursive, it migth be a lot of new variables...
...
...
@@ -289,25 +289,26 @@ and (var_trees_of_val_exp : Eff.local_env -> Eff.id_solver -> acc -> Eff.val_exp
acc
,
A
l
|
_
,
(
S
_
|
L
_
)
->
assert
false
)
|
IDENT
idref
->
let
vi
=
try
id_solver
.
id2var
idref
lxm
with
_
->
raise
(
Errors
.
Compile_error
(
lxm
,
(
"
\n
*** '"
^
(
Ident
.
string_of_idref
idref
)
^
"': Unknown variable.
\n
*** Current variables are: "
^
(
Hashtbl
.
fold
(
fun
id
vi_eff
acc
->
acc
^
(
Format
.
sprintf
"
\n\t
%s"
(
LicDump
.
string_of_var_info_eff4msg
vi_eff
))
)
nenv
.
lenv_vars
""
))))
in
acc
,
gen_var_trees
(
make_val_exp
nenv
lxm
vi
)
""
vi
.
var_type_eff
|
IDENT
idref
->
(
try
let
vi
=
id_solver
.
id2var
idref
lxm
in
(
acc
,
gen_var_trees
(
make_val_exp
nenv
lxm
vi
)
""
vi
.
var_type_eff
)
with
_
->
try
let
_const
=
id_solver
.
id2const
idref
lxm
in
(
acc
,
L
ve
)
with
_
->
let
msg
=
"
\n
*** during Array expansion: '"
^
(
Ident
.
string_of_idref
idref
)
^
"': Unknown variable.
\n
*** Current variables are: "
^
(
Hashtbl
.
fold
(
fun
id
vi_eff
acc
->
acc
^
(
Format
.
sprintf
"
\n\t
%s"
(
LicDump
.
string_of_var_info_eff4msg
vi_eff
)))
nenv
.
lenv_vars
""
)
in
raise
(
Errors
.
Compile_error
(
lxm
,
msg
))
)
|
WITH
(
_
)
|
HAT
(
_
)
|
CONCAT
|
ARRAY
(
_
)
|
Predef
_
|
CALL
_
|
MERGE
_
|
CONST
_
|
PRE
|
ARROW
|
FBY
|
CURRENT
|
WHEN
_
|
TUPLE
...
...
@@ -455,35 +456,9 @@ let (node : Eff.id_solver -> Eff.local_env -> Eff.node_exp -> Eff.node_exp) =
let
inlist
=
n
.
inlist_eff
in
let
outlist
=
n
.
outlist_eff
in
let
acc
=
([]
,
[]
,
[]
)
in
(* let _ = *)
(* print_string *)
(* ("\n*** nenv.lenv_vars (avant) = " ^ *)
(* (Hashtbl.fold *)
(* (fun id vi_eff acc -> *)
(* acc ^ (Format.sprintf *)
(* "\n\t%s" (LicDump.string_of_var_info_eff4msg vi_eff)) *)
(* ) *)
(* n_env.lenv_vars *)
(* "" *)
(* )); *)
(* flush stdout *)
(* in *)
let
inlist
,
acc
=
List
.
fold_left
(
expand_var_info
n_env
is
)
([]
,
acc
)
inlist
in
let
outlist
,
acc
=
List
.
fold_left
(
expand_var_info
n_env
is
)
([]
,
acc
)
outlist
in
let
loclist
,
acc
=
List
.
fold_left
(
expand_var_info
n_env
is
)
([]
,
acc
)
loclist
in
(* let _ = *)
(* print_string ("\n*** nenv.lenv_vars (avant) = "^ *)
(* (Hashtbl.fold *)
(* (fun id vi_eff acc -> *)
(* acc ^ (Format.sprintf *)
(* "\n\t%s" (LicDump.string_of_var_info_eff4msg vi_eff)) *)
(* ) *)
(* n_env.lenv_vars *)
(* "" *)
(* )); *)
(* flush stdout *)
(* in *)
let
acc
=
List
.
fold_left
(
expand_eq
n_env
is
)
acc
b
.
eqs_eff
in
let
acc
=
List
.
fold_left
(
expand_assert
n_env
is
)
acc
b
.
asserts_eff
in
let
(
asserts
,
neqs
,
nv
)
=
acc
in
...
...
This diff is collapsed.
Click to expand it.
src/test/Makefile
+
1
−
1
View file @
01ab2ccb
...
...
@@ -96,7 +96,7 @@ test_ec:
echo
-e
"
\n
$(
NL
)
====>
$(
LC
)
-ec
$$
d -o /tmp/xx.ec"
>>
test_ec.res
;
\
$(
LC0
)
-ec
$$
d
-o
/tmp/xx.ec
>>
test_ec.res 2>&1
;
\
echo
-e
"ec2c /tmp/xx.ec"
>>
test_ec.res
;
\
ec2c /tmp/xx.ec
>>
test_ec.res 2>&1
;
\
(
ec2c /tmp/xx.ec
>>
test_ec.res 2>&1
&&
echo
-n
"ok "
)
||
echo
" KO!"
;
\
done
;
\
diff
-u
test_ec.res.exp test_ec.res
>
test_ec.diff
||
\
(
cat
test.diff
;
echo
"cf test.diff"
;
exit
1
)
...
...
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