Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocamldebug print arrays incorrectly #3098

Closed
vicuna opened this issue Dec 20, 2001 · 2 comments
Closed

ocamldebug print arrays incorrectly #3098

vicuna opened this issue Dec 20, 2001 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Dec 20, 2001

Original bug ID: 739
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: mattias waldau
Version: 3.01+1 (2001-04-19)
OS: Redhat 7.1
Submission from: h225n2fls34o849.telia.com (217.208.235.225)

The program first, compile with 'ocamlc -g mini.ml', then a test run
using the debugger. Note that element 6 to 10 is printed out even
if the array only has the dimension 5.

let calc () : unit =
let arr1x3x2x19x6 = Array.create_matrix 17 5 0. in
let arr1x3x3x19x7 = Array.create_matrix 17 5 0. in
let arr1x3x4x19x8 = Array.create_matrix 17 5 0. in
let arr2x1x1x20x9 = Array.create_matrix 20 9 0. in
let c1x1x1 :float = 1. in
() ;;

let _ = calc () ;;

(ocd) break @ mini 6
Breakpoint 1 at 12652 : file Mini, line 5 column 48
(ocd) r
Time : 166 - pc : 12660 - module Mini
Breakpoint : 1
(ocd) p arr1x3x2x19x6
arr1x3x2x19x6 : float array array =
[|[|0; 0; 0; 0; 0; 6.58459472658; 6.58425998841; 6.58392429505;
6.58358860169; 6.58325290833|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|];
[|0; 0; 0; 0; 0; 5.56416730346e-320; 0; 0; 0; 0|]|]
(ocd)

@vicuna
Copy link
Author

vicuna commented Jan 4, 2002

Comment author: administrator

The program first, compile with 'ocamlc -g mini.ml', then a test run
using the debugger. Note that element 6 to 10 is printed out even
if the array only has the dimension 5.

Well spotted. This is fixed in the working sources. Thanks for the
bug report.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Jan 4, 2002

Comment author: administrator

Fixed 2002-01-04 by XL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant