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

int_of_string #2606

Closed
vicuna opened this issue Nov 7, 2000 · 2 comments
Closed

int_of_string #2606

vicuna opened this issue Nov 7, 2000 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Nov 7, 2000

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

Bug description

Full_Name: c'est dans mon adresse
Version: 3.00
OS: tru64XX
Submission from: oto.inria.fr (192.93.2.2)

    Objective Caml version 3.00

print_endline (Printf.sprintf "0o%o\n" (int_of_string "0o8899"));;

0o11121

  • : unit = ()

On attendrait Invalid Argument ou une autre exception, non ?

Fix: Par exemple, dans byterun/int.c, fn parse_long:
p = parse_sign_and_base(p, &base, &sign);
d = parse_digit(p);
if (d < 0) failwith("int_of_string");
peut-etre que:
if (d < 0 || d >= *base) failwith...
suffirait.

Merci!

@vicuna
Copy link
Author

vicuna commented Nov 7, 2000

Comment author: administrator

    Objective Caml version 3.00

print_endline (Printf.sprintf "0o%o\n" (int_of_string "0o8899"));;

0o11121

  • : unit = ()

On attendrait Invalid Argument ou une autre exception, non ?

Exact. C'est un bug dans OCaml 3.00, qui est maintenant corrige dans la
version de travail. Merci de l'avoir signale.

  • Xavier

@vicuna
Copy link
Author

vicuna commented Nov 7, 2000

Comment author: administrator

Fixed 2000-08-08 by Xavier (see #2548).

@vicuna vicuna closed this as completed Nov 7, 2000
@vicuna vicuna mentioned this issue Mar 14, 2019
@vicuna vicuna added the bug label Mar 19, 2019
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