From c3178cb6b6277f8a7c728a0533f13e5aee17c803 Mon Sep 17 00:00:00 2001
From: Erwan Jahier <jahier@imag.fr>
Date: Thu, 9 Oct 2014 17:57:50 +0200
Subject: [PATCH] Fix a bug in -en (that was only visible when using -2c).

Basically, I've missed some substitutions in Merge and in clocks.

This one was spotted by willie.
---
 _oasis                |  2 +-
 src/l2lExpandNodes.ml |  8 +++++---
 src/lv6MainArgs.ml    | 12 ++++++------
 src/lv6version.ml     |  4 ++--
 test/lus2lic.sum      | 24 +++++++++++++-----------
 test/lus2lic.time     | 14 ++++++++------
 6 files changed, 35 insertions(+), 29 deletions(-)

diff --git a/_oasis b/_oasis
index e25ebfdd..57aec059 100644
--- a/_oasis
+++ b/_oasis
@@ -18,7 +18,7 @@ Executable lus2lic
   BuildDepends: str,unix,num,rdbg-plugin
   Build:true
   CompiledObject: native
-	#  CompiledObject: byte
+#  CompiledObject: byte
 
 # to use ocamldebug:
 #  - here: set CompiledObject from native to byte
diff --git a/src/l2lExpandNodes.ml b/src/l2lExpandNodes.ml
index ea965582..ce4df80d 100644
--- a/src/l2lExpandNodes.ml
+++ b/src/l2lExpandNodes.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 02/10/2014 (at 14:33) by Erwan Jahier> *)
+(* Time-stamp: <modified the 09/10/2014 (at 17:31) by Erwan Jahier> *)
 
 
 open Lxm
@@ -78,7 +78,9 @@ and (subst_in_clock : subst -> clock -> clock) =
 and (subst_in_val_exp : subst -> val_exp -> val_exp) =
   fun s ve -> 
     let newve = {
-      ve with ve_core =
+      ve with 
+        ve_clk = List.map (subst_in_clock s) ve.ve_clk;
+        ve_core =
         match ve.ve_core with
 	       | CallByPosLic (by_pos_op, vel) -> 
             let lxm = by_pos_op.src in
@@ -108,7 +110,7 @@ and (subst_in_val_exp : subst -> val_exp -> val_exp) =
             CallByNameLic(by_name_op, fl) 
           | Merge(ce,cl) ->
             let cl = List.map (fun (id,ve) -> (id, subst_in_val_exp s ve)) cl in
-            Merge(ce, cl)
+            Merge(subst_in_val_exp s ce, cl)
     }
     in
     newve
diff --git a/src/lv6MainArgs.ml b/src/lv6MainArgs.ml
index 506f5acc..c9afc552 100644
--- a/src/lv6MainArgs.ml
+++ b/src/lv6MainArgs.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 09/10/2014 (at 16:33) by Erwan Jahier> *)
+(* Time-stamp: <modified the 09/10/2014 (at 16:37) by Erwan Jahier> *)
 (*
 Le manager d'argument adapté de celui de lutin, plus joli
 N.B. solution un peu batarde : les options sont stockées, comme avant, dans Global,
@@ -347,6 +347,11 @@ let mkoptab (opt:t) : unit = (
       ["Test the syntactic analysis"]
     ;
     *)
+    mkopt opt ~hide:true
+      ["-cc"]
+      (Arg.Unit (fun i -> opt.launch_cc <- true))
+      ["Try to compile the generated C files (requires -2c)"]
+    ;
     mkopt opt ~hide:true
       ["--2c-no-switch"]
       (Arg.Unit (fun () -> global_opt.soc2c_no_switch <-true))
@@ -367,11 +372,6 @@ let mkoptab (opt:t) : unit = (
       (Arg.Int (fun i -> opt.precision <- Some i))
       ["Number of digits after ther dot used to print floats"]
     ;
-    mkopt opt ~hide:true
-      ["-cc"]
-      (Arg.Unit (fun i -> opt.launch_cc <- true))
-      ["Try to compile the generated C files (requires -2c)"]
-    ;
     mkopt opt ~hide:true
       ["--nonreg-test"]
       (Arg.Unit (fun () -> global_opt.nonreg_test <- true))
diff --git a/src/lv6version.ml b/src/lv6version.ml
index 425e0081..8ce205c2 100644
--- a/src/lv6version.ml
+++ b/src/lv6version.ml
@@ -1,7 +1,7 @@
 (** Automatically generated from Makefile *) 
 let tool = "lus2lic"
 let branch = "(no"
-let commit = "537"
-let sha_1 = "244b252de2d9002b9e87972eb28532fea2fedcad"
+let commit = "538"
+let sha_1 = "ec662f2854628055e0b1e1ce992a6eb3189fca6d"
 let str = (branch ^ "." ^ commit ^ " (" ^ sha_1 ^ ")")
 let maintainer = "jahier@imag.fr"
diff --git a/test/lus2lic.sum b/test/lus2lic.sum
index 0b56e984..b2fdef79 100644
--- a/test/lus2lic.sum
+++ b/test/lus2lic.sum
@@ -1,5 +1,5 @@
 ==> lus2lic0.sum <==
-Test Run By jahier on Thu Oct  9 16:24:18 
+Test Run By jahier on Thu Oct  9 17:55:51 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic0 tests ===
@@ -63,7 +63,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte
 XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus
 
 ==> lus2lic1.sum <==
-Test Run By jahier on Thu Oct  9 16:24:19 
+Test Run By jahier on Thu Oct  9 17:55:49 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic1 tests ===
@@ -397,7 +397,7 @@ PASS: gcc -o multipar.exec multipar_multipar.c multipar_multipar_loop.c
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus  {}
 
 ==> lus2lic2.sum <==
-Test Run By jahier on Thu Oct  9 16:24:38 
+Test Run By jahier on Thu Oct  9 17:55:57 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic2 tests ===
@@ -727,7 +727,7 @@ PASS: gcc -o zzz2.exec zzz2_zzz2.c zzz2_zzz2_loop.c
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus  {}
 
 ==> lus2lic3.sum <==
-Test Run By jahier on Thu Oct  9 16:25:39 
+Test Run By jahier on Thu Oct  9 17:55:55 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic3 tests ===
@@ -1230,7 +1230,7 @@ PASS: ./myec2c {-o multipar.c multipar.ec}
 PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
 
 ==> lus2lic4.sum <==
-Test Run By jahier on Thu Oct  9 16:25:57 
+Test Run By jahier on Thu Oct  9 17:55:53 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic4 tests ===
@@ -1727,11 +1727,13 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {}
 ===============================
 # Total number of failures: 14
 lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 0 seconds
-lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 19 seconds
-lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 61 seconds
-lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 18 seconds
-lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 65 seconds
+lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 21 seconds
+lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 63 seconds
+lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 19 seconds
+lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 67 seconds
 * Ref time: 
-0.06user 0.07system 2:44.11elapsed 0%CPU (0avgtext+0avgdata 3000maxresident)k
-120inputs+0outputs (0major+14855minor)pagefaults 0swaps
+0.03user 0.06system 2:43.55elapsed 0%CPU (0avgtext+0avgdata 3004maxresident)k
+120inputs+0outputs (0major+14860minor)pagefaults 0swaps
 * Quick time (-j 4):
+0.04user 0.06system 1:12.11elapsed 0%CPU (0avgtext+0avgdata 3004maxresident)k
+120inputs+0outputs (0major+14864minor)pagefaults 0swaps
diff --git a/test/lus2lic.time b/test/lus2lic.time
index a1e9d348..18a0a584 100644
--- a/test/lus2lic.time
+++ b/test/lus2lic.time
@@ -1,9 +1,11 @@
 lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 0 seconds
-lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 19 seconds
-lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 61 seconds
-lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 18 seconds
-lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 65 seconds
+lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 21 seconds
+lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 63 seconds
+lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 19 seconds
+lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 67 seconds
 * Ref time: 
-0.06user 0.07system 2:44.11elapsed 0%CPU (0avgtext+0avgdata 3000maxresident)k
-120inputs+0outputs (0major+14855minor)pagefaults 0swaps
+0.03user 0.06system 2:43.55elapsed 0%CPU (0avgtext+0avgdata 3004maxresident)k
+120inputs+0outputs (0major+14860minor)pagefaults 0swaps
 * Quick time (-j 4):
+0.04user 0.06system 1:12.11elapsed 0%CPU (0avgtext+0avgdata 3004maxresident)k
+120inputs+0outputs (0major+14864minor)pagefaults 0swaps
-- 
GitLab