Browse Source

fixed switch on Null<Int> verify error

Nicolas Cannasse 16 năm trước cách đây
mục cha
commit
c0df820511
2 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 1 0
      doc/CHANGES.txt
  2. 3 0
      genswf9.ml

+ 1 - 0
doc/CHANGES.txt

@@ -15,6 +15,7 @@ TODO :
 	js : small syntax fix with value-blocks
 	js : fixed Type.enumEq with null values
 	js/flash8 : use &0xFF in haxe.io.Bytes.set
+	flash9 : fixed switch on Null<Int> verify error
 
 2009-03-22: 2.03
 	optimized Type.enumEq : use index instead of tag comparison for neko/flash9/php

+ 3 - 0
genswf9.ml

@@ -1071,6 +1071,9 @@ let rec gen_expr_content ctx retval e =
 				if n < 0 || n > 512 then raise Exit;
 			) vl) el;
 			gen_expr ctx true e0;
+			(match classify ctx e0.etype with
+			| KInt | KUInt -> ()
+			| _ -> write ctx HToInt);
 			let switch, case = begin_switch ctx in
 			(match eo with
 			| None ->