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

exception pour String.get #8244

Closed
vicuna opened this issue Aug 20, 2003 · 1 comment
Closed

exception pour String.get #8244

vicuna opened this issue Aug 20, 2003 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Aug 20, 2003

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

Bug description

Bonjour,

Ne serait-ce pas un bug que l'exception levée par String.get en cas de
mauvais indexe soit :

  • Invalid_argument ("String.get") quand on compile avec ocamlc
  • et Invalid_argument ("out-of-bound array or string access") quand on
    compile avec ocamlopt ?

L'effet pervers est qu'un même programme peut s'exécuter différemment
selon qu'il est compilé en natif ou pas. Par exemple :

try
print_char "".[0]
with
| Invalid_argument ("String.get") -> ()

plante dans un cas et pas dans l'autre.

Enfin, tout cela doit vous sembler platement trivial mais si cette
modeste remarque peut contribuer à embellir votre bel édifice, j'en
serai heureux.

Cordialement,

laurent

@vicuna
Copy link
Author

vicuna commented Jun 12, 2004

Comment author: administrator

Exception is now Invalid_argument("index out of bounds") both in bytecode and
native code. 2004-06-??, XL

@vicuna vicuna closed this as completed Jun 12, 2004
@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