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

Encore un bug dans -pack ? #3919

Closed
vicuna opened this issue Dec 12, 2005 · 3 comments
Closed

Encore un bug dans -pack ? #3919

vicuna opened this issue Dec 12, 2005 · 3 comments
Assignees
Labels

Comments

@vicuna
Copy link

vicuna commented Dec 12, 2005

Original bug ID: 3919
Reporter: @alainfrisch
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2005-12-17T16:50:56Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.09.0
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @alainfrisch

Bug description

Soient les deux fichiers ci-dessous:

a.ml: let r = ref 0
b.ml: let _ = !A.r

Alors la séquence suivante provoque un segfault avec la version courante du CVS:

ocamlopt -for-pack X.Y -c a.ml
ocamlopt -for-pack X.Y -c b.ml
ocamlopt -for-pack X -pack -o y.cmx a.cmx b.cmx
ocamlopt -pack -o x.cmx y.cmx
ocamlopt -o bug x.cmx
./bug

@vicuna
Copy link
Author

vicuna commented Dec 13, 2005

Comment author: @alainfrisch

Ok, ça semble facile à corriger:

Index: asmcomp/asmpackager.ml

RCS file: /caml/ocaml/asmcomp/asmpackager.ml,v
retrieving revision 1.19.2.1
diff -r1.19.2.1 asmpackager.ml
131c131
< union (List.map (fun info -> info.ui_defines) units);

      List.rev (union (List.map (fun info -> List.rev info.ui_defines) units));

@vicuna
Copy link
Author

vicuna commented Dec 16, 2005

Comment author: anonymous

J'ai fait n'importe quoi. C'est plutôt:

List.rev (union (List.map (fun info -> info.ui_defines) (List.rev units)))

(car units est déjà dans le mauvais ordre)

@vicuna
Copy link
Author

vicuna commented Dec 17, 2005

Comment author: @xavierleroy

Tentative fix in 3.09 branch. Repro case works as expected.

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

2 participants