From 2a72628f201b8ed3fe0f016350e899827a892227 Mon Sep 17 00:00:00 2001 From: Adrien Guatto Date: Mon, 19 Jul 2010 11:40:55 +0200 Subject: [PATCH] Stricter mk_longname. --- compiler/global/names.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/global/names.ml b/compiler/global/names.ml index 96c7f79..7c9dcbd 100644 --- a/compiler/global/names.ml +++ b/compiler/global/names.ml @@ -53,6 +53,8 @@ let fullname = function let mk_longname s = try let ind = String.index s '.' in + if ind = 0 || ind = String.length s - 1 + then invalid_arg "mk_longname: ill-formed identifier"; let id = String.sub s (ind + 1) (String.length s - ind - 1) in Modname { qual = String.sub s 0 ind; id = id; } with Not_found -> Name s