浏览代码

fixed issue 735

Franco Ponticelli 13 年之前
父节点
当前提交
ea8cfa34cc
共有 1 个文件被更改,包括 7 次插入1 次删除
  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 "[";