|
@@ -450,8 +450,6 @@ let is_interface_type t =
|
|
| _ -> false
|
|
| _ -> false
|
|
;;
|
|
;;
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
let is_cpp_function_instance haxe_type =
|
|
let is_cpp_function_instance haxe_type =
|
|
match follow haxe_type with
|
|
match follow haxe_type with
|
|
| TInst (klass,params) ->
|
|
| TInst (klass,params) ->
|
|
@@ -477,6 +475,21 @@ let is_fromStaticFunction_call func =
|
|
| _ -> false
|
|
| _ -> false
|
|
;;
|
|
;;
|
|
|
|
|
|
|
|
+let is_addressOf_call func =
|
|
|
|
+ match (remove_parens func).eexpr with
|
|
|
|
+ | TField (_,FStatic ({cl_path=["cpp"],"Pointer"},{cf_name="addressOf"} ) ) -> true
|
|
|
|
+ | _ -> false
|
|
|
|
+;;
|
|
|
|
+
|
|
|
|
+let is_lvalue var =
|
|
|
|
+ match (remove_parens var).eexpr with
|
|
|
|
+ | TLocal _ -> true
|
|
|
|
+ | TField (_,FStatic(_,field) ) | TField (_,FInstance(_,field) ) -> is_var_field field
|
|
|
|
+ | _ -> false
|
|
|
|
+;;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
let is_pointer haxe_type =
|
|
let is_pointer haxe_type =
|
|
match follow haxe_type with
|
|
match follow haxe_type with
|
|
| TInst (klass,params) ->
|
|
| TInst (klass,params) ->
|
|
@@ -1873,6 +1886,9 @@ and gen_expression ctx retval expression =
|
|
| _ -> error "fromStaticFunction must take a static function" expression.epos;
|
|
| _ -> error "fromStaticFunction must take a static function" expression.epos;
|
|
)
|
|
)
|
|
|
|
|
|
|
|
+ | TCall (func, [arg]) when is_addressOf_call func && not (is_lvalue arg) ->
|
|
|
|
+ error "addressOf must take a local or member variable" expression.epos;
|
|
|
|
+
|
|
| TCall (func, arg_list) ->
|
|
| TCall (func, arg_list) ->
|
|
let rec is_variable e = match e.eexpr with
|
|
let rec is_variable e = match e.eexpr with
|
|
| TField _ | TEnumParameter _ -> false
|
|
| TField _ | TEnumParameter _ -> false
|