diff options
Diffstat (limited to 'bytecomp')
-rw-r--r-- | bytecomp/lambda.ml | 2 | ||||
-rw-r--r-- | bytecomp/matching.ml | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/bytecomp/lambda.ml b/bytecomp/lambda.ml index aa56c31fa..1c82898c6 100644 --- a/bytecomp/lambda.ml +++ b/bytecomp/lambda.ml @@ -204,6 +204,8 @@ let rec same l1 l2 = match (l1, l2) with | Lvar v1, Lvar v2 -> Ident.same v1 v2 + | Lconst (Const_base (Const_string _)), _ -> + false (* do not share strings *) | Lconst c1, Lconst c2 -> c1 = c2 | Lapply(a1, bl1, _), Lapply(a2, bl2, _) -> diff --git a/bytecomp/matching.ml b/bytecomp/matching.ml index b6ba0ac86..5e01d4f4b 100644 --- a/bytecomp/matching.ml +++ b/bytecomp/matching.ml @@ -443,7 +443,9 @@ let pretty_precompiled_res first nexts = -(* A slight attempt to identify semantically equivalent lambda-expressions *) +(* A slight attempt to identify semantically equivalent lambda-expressions, + We could have used Lambda.same, but our goal here is also to + find alpha-equivalent (simple) terms *) exception Not_simple let rec raw_rec env : lambda -> lambda = function @@ -454,6 +456,8 @@ let rec raw_rec env : lambda -> lambda = function end | Lprim (Pfield i,args) -> Lprim (Pfield i, List.map (raw_rec env) args) + | Lconst (Const_base (Const_string _)) -> + raise Not_simple (* do not share strings *) | Lconst _ as l -> l | Lstaticraise (i,args) -> Lstaticraise (i, List.map (raw_rec env) args) |