You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 197 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: feature Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Claude Marche
Version: 3.00
OS: Linux
Submission from: pc801.lri.fr (129.175.8.109)
C'est clairement mis en evidence par le test ci-dessous. Le bug a lieu avec
ocamlc pas ocamlopt
pc801:~> cat bug.ml
let f () =
let s = "+" in
Format.print_string (if s = "+" then "ok\n" else "bug\n");
String.set s 0 '-'
;;
f ();;
f ();;
pc801:> ocamlc -o bug bug.ml
pc801:> ./bug
ok
bug
pc801:> ocamlopt -o bug bug.ml
pc801:> ./bug
ok
ok
pc801:~>
The text was updated successfully, but these errors were encountered:
Literal strings are mutable in OCaml and we can't reasonably change this
behavior. For ocamlopt, the test "works" because the two "+" literal strings
are re-shared by the code generator! This questionable behavior removed
2001-04-02 by XL because it caused other problems.
Original bug ID: 197
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Claude Marche
Version: 3.00
OS: Linux
Submission from: pc801.lri.fr (129.175.8.109)
C'est clairement mis en evidence par le test ci-dessous. Le bug a lieu avec
ocamlc pas ocamlopt
pc801:~> cat bug.ml
let f () =
let s = "+" in
Format.print_string (if s = "+" then "ok\n" else "bug\n");
String.set s 0 '-'
;;
f ();;
f ();;
pc801:
> ocamlc -o bug bug.ml> ./bugpc801:
ok
bug
pc801:
> ocamlopt -o bug bug.ml> ./bugpc801:
ok
ok
pc801:~>
The text was updated successfully, but these errors were encountered: