Просмотр исходного кода

prevent erasing UInt to Float cast

Nicolas Cannasse 8 лет назад
Родитель
Сommit
5c8d9e8db1
1 измененных файлов с 2 добавлено и 2 удалено
  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