Permalink
Browse files

PR#5810: error in switch printing when using -dclambda

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13073 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information...
1 parent ed9b51a commit 3be87f121b3a34eda4f7476aad26a120780740e1 xclerc committed Nov 7, 2012
Showing with 7 additions and 6 deletions.
  1. +1 −0 Changes
  2. +6 −6 asmcomp/printclambda.ml
View
1 Changes
@@ -55,6 +55,7 @@ Bug fixes:
- PR#5775: several bug fixes for tools/pprintast.ml
- PR#5785: misbehaviour with abstracted structural type used as GADT index
- PR#5806: ensure that backtrace tests are always run (testsuite)
+- PR#5810: error in switch printing when using -dclambda
OCaml 4.00.1:
View
12 asmcomp/printclambda.ml
@@ -71,16 +71,16 @@ let rec lam ppf = function
let switch ppf sw =
let spc = ref false in
for i = 0 to Array.length sw.us_index_consts - 1 do
- let n = sw.us_index_consts.(i)
- and l = sw.us_actions_consts.(i) in
+ let n = sw.us_index_consts.(i) in
+ let l = sw.us_actions_consts.(n) in
if !spc then fprintf ppf "@ " else spc := true;
- fprintf ppf "@[<hv 1>case int %i:@ %a@]" n lam l;
+ fprintf ppf "@[<hv 1>case int %i:@ %a@]" i lam l;
done;
for i = 0 to Array.length sw.us_index_blocks - 1 do
- let n = sw.us_index_blocks.(i)
- and l = sw.us_actions_blocks.(i) in
+ let n = sw.us_index_blocks.(i) in
+ let l = sw.us_actions_blocks.(n) in
if !spc then fprintf ppf "@ " else spc := true;
- fprintf ppf "@[<hv 1>case tag %i:@ %a@]" n lam l;
+ fprintf ppf "@[<hv 1>case tag %i:@ %a@]" i lam l;
done in
fprintf ppf
"@[<1>(switch %a@ @[<v 0>%a@])@]"

0 comments on commit 3be87f1

Please sign in to comment.