2
0
Nicolas Cannasse 15 жил өмнө
parent
commit
36274cfc16
2 өөрчлөгдсөн 3 нэмэгдсэн , 3 устгасан
  1. 1 0
      doc/CHANGES.txt
  2. 2 3
      genswf9.ml

+ 1 - 0
doc/CHANGES.txt

@@ -27,6 +27,7 @@
 	all : bugfix with non-constant enums in switches
 	flash9 : fix for interfaces (use namespace)
 	all : "using" now works for identifiers in member methods
+	flash9 : bugfix with switch on some big integers
 
 2009-07-26: 2.04
 	flash9 : fixed get_full_path error with -D fdb

+ 2 - 3
genswf9.ml

@@ -1078,13 +1078,12 @@ let rec gen_expr_content ctx retval e =
 			if t0 <> KInt && t0 <> KUInt then raise Exit;
 			let rec get_int e =
 				match e.eexpr with
-				| TConst (TInt n) -> Int32.to_int n
+				| TConst (TInt n) -> if n < 0l || n > 512l then raise Exit; Int32.to_int n
 				| TParenthesis e | TBlock [e] -> get_int e
 				| _ -> raise Not_found
 			in
 			List.iter (fun (vl,_) -> List.iter (fun v ->
-				let n = (try get_int v with _ -> raise Exit) in
-				if n < 0 || n > 512 then raise Exit;
+				try ignore (get_int v) with _ -> raise Exit
 			) vl) el;
 			gen_expr ctx true e0;
 			if t0 <> KInt then write ctx HToInt;