Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000076OCamlOCaml generalpublic2000-04-03 03:522000-04-03 04:24
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000076: Dbm.iter throws Not_found on empty database
DescriptionFull_Name: David Clarke
Version: 2.99
OS: Redhat Linix 6.1
Submission from: 203.28.51.70 (203.28.51.70)



Calling Dbm.iter on a database which has no entries results in
a Not_found exception being thrown. This is contrary to the specification.

It throws the exception in the call to "firstkey", as specified.
The following minor change should fix the problem (see the last line)

From dbm.ml:

(* Usual iterator *)
let iter f t =
  let rec walk k =
    f k (find t k);
    match try Some(nextkey t) with Not_found -> None
    with
         None -> ()
       | Some k -> walk k
  in
(* walk (firstkey t) -- current line *)
    try walk (firstkey t) with Not_found -> ()

Thanks
Dave
                                                       

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000344)
administrator (administrator)
2000-04-03 04:24

Thanks for your report.

It is now fixed in the CVS version.
The Db library has been corrected identically.
(0000345)
administrator (administrator)
2000-04-03 04:24

Fixed in 3.00.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker