Nicolas Cannasse 18 سال پیش
والد
کامیت
ec0f707cf0
4فایلهای تغییر یافته به همراه9 افزوده شده و 3 حذف شده
  1. 1 0
      doc/CHANGES.txt
  2. 1 0
      genas3.ml
  3. 3 2
      genswf8.ml
  4. 4 1
      typer.ml

+ 1 - 0
doc/CHANGES.txt

@@ -11,6 +11,7 @@
 	bugfix in serialization format with USE_ENUM_INDEXES
 	added apis in DateTools for time manipulation
 	bugfix in flash9 : strictly typed local vars used in local functions
+	always force swf version and sandbox redefinition
 
 2007-10-31: 1.16
 	use _sans font for default flash traces (better Linux support)

+ 1 - 0
genas3.ml

@@ -65,6 +65,7 @@ let s_ident n =
 	| "is" -> "_is"
 	| "as" -> "_as"
 	| "int" -> "_int"
+	| "const" -> "_const"
 	| "getTimer" -> "_getTimer"
 	| "typeof" -> "_typeof"
 	| "parseInt" -> "_parseInt"

+ 3 - 2
genswf8.ml

@@ -1387,7 +1387,7 @@ let convert_header ver (w,h,fps,bg) =
 			bottom = h * 20;
 		};
 		h_frame_count = 1;
-		h_fps = to_float16 fps;
+		h_fps = to_float16 (if fps > 127.0 then 127.0 else fps);
 		h_compressed = not (Plugin.defined "no-swf-compress");
 	} , bg
 
@@ -1547,7 +1547,8 @@ let generate file ver header infile types hres =
 			let ch = IO.input_channel (open_in_bin file) in
 			let h, swf = (try Swf.parse ch with _ -> failwith ("The input swf " ^ file ^ " is corrupted")) in
 			let header , tagbg = (match header with
-				| None -> h , None
+				| None -> 
+					{ h with h_version = ver }, None
 				| Some h ->
 					let h , bg = convert_header ver h in
 					let tagbg = tag (TSetBgColor { cr = bg lsr 16; cg = (bg lsr 8) land 0xFF; cb = bg land 0xFF }) in

+ 4 - 1
typer.ml

@@ -1749,7 +1749,10 @@ and type_expr ctx ?(need_val=true) (e,p) =
 		let e1 = type_expr ctx ~need_val e1 in
 		(match e2 with
 		| None ->
-			mk (TIf (e,e1,if need_val then Some (null p) else None)) (t_void ctx) p
+			if need_val then
+				mk (TIf (e,e1,Some (null p))) e1.etype p
+			else
+				mk (TIf (e,e1,None)) (t_void ctx) p
 		| Some e2 ->
 			let e2 = type_expr ctx ~need_val e2 in
 			let t = if not need_val then t_void ctx else (try