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

Bug dans la compilation des motifs... #3132

Closed
vicuna opened this issue Jan 8, 2002 · 2 comments
Closed

Bug dans la compilation des motifs... #3132

vicuna opened this issue Jan 8, 2002 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jan 8, 2002

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

Bug description

Bonjour,

bytecomp/matching.ml et bytecomp/switch.ml utilisent une fonction
make_offset définie de la façon suivante :

let make_offset x arg = if x=0 then arg else Lprim(Poffsetint(x), [arg])

où x peut être à peu près n'importe quel entier.

Dans asmcomp/cmmgen.ml, "Lprim(Poffsetint(x), [arg])" est compilé par
"add_const (transl arg) (x lsl 1)" où "x lsl 1" peu déborder si "x"
est trop grand où trop petit.

Ainsi, certains motifs ne sont pas compilés correctement. Par exemple :

let f =
function -1073741824 -> 0 | -1073741823 -> 1 | -1073741822 -> 2 | _ -> 3
let _ =
Format.eprintf "%d@." (f (-1073741823))

-- Jérome

@vicuna
Copy link
Author

vicuna commented Jan 10, 2002

Comment author: administrator

Corrige' et commis.

Merci.

--Luc

@vicuna
Copy link
Author

vicuna commented Jan 10, 2002

Comment author: administrator

Fixed by Luc (2002-01-10)

@vicuna vicuna closed this as completed Jan 10, 2002
@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