Browse Source

prevent erasing UInt to Float cast

Nicolas Cannasse 8 years ago
parent
commit
5c8d9e8db1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/generators/genhl.ml

+ 2 - 2
src/generators/genhl.ml

@@ -2389,9 +2389,9 @@ and eval_expr ctx e =
 		ctx.m.mcontinues <- oldc;
 		ctx.m.mloop_trys <- oldtrys;
 		alloc_tmp ctx HVoid
-	| TCast ({ eexpr = TCast (v,_) },a) ->
+	| TCast ({ eexpr = TCast (v,None) },None) when not (is_number (to_type ctx e.etype)) ->
         (* coalesce double casts into a single runtime check - temp fix for Map accesses *)
-        eval_expr ctx { e with eexpr = TCast(v,a) }
+        eval_expr ctx { e with eexpr = TCast(v,None) }
 	| TCast (v,None) ->
 		let t = to_type ctx e.etype in
 		let rv = eval_expr ctx v in