diff options
author | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2014-09-19 10:23:46 +0200 |
---|---|---|
committer | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2014-09-19 10:38:43 +0200 |
commit | 0d90ab680abd1f558f1c20b79b66ca6b71864fbf (patch) | |
tree | 5fa2cb4c3770ecd802b85cfa9c82c54508d6915a /pretyping | |
parent | 07e4438bd758c2ced8caf09a6961ccd77d84e42b (diff) |
Fixing #3641 (loop in e_contextually, introduced in r16525).
Diffstat (limited to 'pretyping')
-rw-r--r-- | pretyping/tacred.ml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pretyping/tacred.ml b/pretyping/tacred.ml index 39015d89a..f0d0d4526 100644 --- a/pretyping/tacred.ml +++ b/pretyping/tacred.ml @@ -943,6 +943,8 @@ let matches_head env sigma c t = | Proj (p, _) -> ConstrMatching.matches env sigma c (mkConst p) | _ -> raise ConstrMatching.PatternMatchingFailure +let is_pattern_meta = function Pattern.PMeta _ -> true | _ -> false + let e_contextually byhead (occs,c) f env sigma t = let (nowhere_except_in,locs) = Locusops.convert_occs occs in let maxocc = List.fold_right max locs 0 in @@ -960,7 +962,9 @@ let e_contextually byhead (occs,c) f env sigma t = else not (Int.List.mem !pos locs) in incr pos; if ok then - let subst' = Id.Map.map (traverse envc) subst in + let subst' = + if is_pattern_meta c then subst + else (* progress is ensured *) Id.Map.map (traverse envc) subst in let evm, t = f subst' env !evd t in (evd := evm; t) else if byhead then |