Skip to content

Commit

Permalink
[cs] Fix security error on windows
Browse files Browse the repository at this point in the history
Fix generic type checking with -D dll_import
Disable WeakMap for now since it's broken (hxgeneric error)
  • Loading branch information
waneck committed Mar 15, 2015
1 parent 4aef533 commit 67d74cd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion gencs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3257,7 +3257,13 @@ let configure gen =
if Common.defined gen.gcon Define.DllImport then begin
Hashtbl.iter (fun _ md -> match md with
| TClassDecl ({ cl_extern = false } as c) -> (try
ignore (List.find (function (_,_,_,lookup) -> is_some (lookup c.cl_path)) haxe_libs);
let extra = match c.cl_params with
| _ :: _ when not erase_generics -> "_" ^ string_of_int (List.length c.cl_params)
| _ -> ""
in
let path = (fst c.cl_path, snd c.cl_path ^ extra) in
ignore (List.find (function (_,_,_,lookup) ->
is_some (lookup path)) haxe_libs);
c.cl_extern <- true;
with | Not_found -> ())
| _ -> ()) gen.gtypes
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/misc/csTwoLibs/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Main
{
public static function main()
{
var asm = cs.system.reflection.Assembly.LoadFile("bin/lib1/bin/lib1.dll");
var asm = cs.system.reflection.Assembly.LoadFile(sys.FileSystem.fullPath("bin/lib1/bin/lib1.dll"));
var tp:Dynamic = asm.GetType("Lib1");
var obj = tp.test();
trace(obj);
Expand Down
2 changes: 2 additions & 0 deletions tests/misc/csTwoLibs/compile.hxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ cs.Boot
-cs bin/haxeboot
--next
-net-lib bin/haxeboot/bin/haxeboot.dll
-dce no
-D dll_import
Lib1
-cs bin/lib1
--next
-net-lib bin/haxeboot/bin/haxeboot.dll
-dce no
-D dll_import
-main Main
-cs bin/main

0 comments on commit 67d74cd

Please sign in to comment.