Selaa lähdekoodia

fixed issue 735

Franco Ponticelli 13 vuotta sitten
vanhempi
commit
ea8cfa34cc
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7 1
      genphp.ml

+ 7 - 1
genphp.ml

@@ -739,7 +739,7 @@ and gen_field_access ctx isvar e s =
 		gen_value ctx e;
 		spr ctx ")";
 		gen_member_access ctx isvar e s
-	| TCast (ec, _) when (match ec.eexpr with | TNew _ -> true | _ -> false) ->
+	| TCast (ec, _) when (match ec.eexpr with | TNew _ | TArrayDecl _ -> true | _ -> false) ->
 		spr ctx "_hx_deref(";
 		ctx.is_call <- false;
 		gen_value ctx e;
@@ -900,6 +900,12 @@ and gen_expr ctx e =
 			spr ctx ", ";
 			gen_value ctx e2;
 			spr ctx ")";
+		| TCast (ec, _) when (match ec.eexpr with | TArrayDecl _ -> true | _ -> false) ->
+			spr ctx "_hx_array_get(";
+			gen_value ctx e1;
+			spr ctx ", ";
+			gen_value ctx e2;
+			spr ctx ")";
 		| _ ->
 			gen_value ctx e1;
 			spr ctx "[";