git.annexia.org
/
ocaml-bitstring.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f51558a
)
Don't allow zero-length patterns to be loaded from a file
author
Richard W.M. Jones
<rich@annexia.org>
Fri, 4 Jul 2008 12:35:06 +0000
(12:35 +0000)
committer
Richard W.M. Jones
<rich@annexia.org>
Fri, 4 Jul 2008 12:35:06 +0000
(12:35 +0000)
pa_bitmatch.ml
patch
|
blob
|
history
diff --git
a/pa_bitmatch.ml
b/pa_bitmatch.ml
index
ef4d8eb
..
98151a3
100644
(file)
--- a/
pa_bitmatch.ml
+++ b/
pa_bitmatch.ml
@@
-791,7
+791,10
@@
let load_patterns_from_file _loc filename =
let names = List.rev !names in
List.iter (
function
- | name, P.Pattern patt -> add_named_pattern _loc name patt
+ | name, P.Pattern patt ->
+ if patt = [] then
+ locfail _loc (sprintf "pattern %s: no fields" name);
+ add_named_pattern _loc name patt
| _, P.Constructor _ -> () (* just ignore these for now *)
) names