@@ -230,7 +230,7 @@ module Setup = struct
230
230
let setup_common_context ctx =
231
231
let com = ctx.com in
232
232
ctx.com.print < - ctx.comm.write_out;
233
- Common. define_value com Define. HaxeVer (Printf. sprintf " %.3f" (float_of_int Globals. version /. 1000. ));
233
+ Common. define_value com Define. HaxeVer (Printf. sprintf " %.3f" (float_of_int version /. 1000. ));
234
234
Common. raw_define com " haxe3" ;
235
235
Common. raw_define com " haxe4" ;
236
236
Common. raw_define com " haxe5" ;
@@ -296,6 +296,7 @@ let do_type ctx mctx actx display_file_dot_path =
296
296
Some (MacroContext. call_init_macro ctx.com mctx path)
297
297
) mctx (List. rev actx.config_macros) in
298
298
enter_stage com CInitMacrosDone ;
299
+ update_platform_config com; (* make sure to adapt all flags changes defined during init macros *)
299
300
ServerMessage. compiler_stage com;
300
301
301
302
let macros = match mctx with None -> None | Some mctx -> mctx.g.macros in
@@ -309,7 +310,10 @@ let do_type ctx mctx actx display_file_dot_path =
309
310
com.callbacks#run com.error_ext com.callbacks#get_after_init_macros;
310
311
run_or_diagnose ctx (fun () ->
311
312
if com.display.dms_kind <> DMNone then DisplayTexpr. check_display_file tctx cs;
312
- List. iter (fun cpath -> ignore(tctx.Typecore. g.Typecore. do_load_module tctx cpath null_pos)) (List. rev actx.classes);
313
+ List. iter (fun cpath ->
314
+ ignore(tctx.Typecore. g.Typecore. do_load_module tctx cpath null_pos);
315
+ Typecore. flush_pass tctx.g PBuildClass " actx.classes"
316
+ ) (List. rev actx.classes);
313
317
Finalization. finalize tctx;
314
318
);
315
319
end with TypeloadParse. DisplayInMacroBlock ->
@@ -418,6 +422,10 @@ let compile ctx actx callbacks =
418
422
) (List. rev actx.cmds)
419
423
end
420
424
425
+ let make_ice_message com msg backtrace =
426
+ let ver = (s_version_full com.version) in
427
+ let os_type = if Sys. unix then " unix" else " windows" in
428
+ Printf. sprintf " %s\n Haxe: %s; OS type: %s;\n %s" msg ver os_type backtrace
421
429
let compile_safe ctx f =
422
430
let com = ctx.com in
423
431
try
@@ -445,6 +453,12 @@ with
445
453
handle_diagnostics ctx msg null_pos DKCompilerMessage ;
446
454
| Failure msg when not Helper. is_debug_run ->
447
455
error ctx (" Error: " ^ msg) null_pos
456
+ | Globals. Ice (msg ,backtrace ) when is_diagnostics com ->
457
+ let s = make_ice_message com msg backtrace in
458
+ handle_diagnostics ctx s null_pos DKCompilerMessage
459
+ | Globals. Ice (msg ,backtrace ) when not Helper. is_debug_run ->
460
+ let s = make_ice_message com msg backtrace in
461
+ error ctx (" Error: " ^ s) null_pos
448
462
| Helper. HelpMessage msg ->
449
463
print_endline msg
450
464
| Parser. TypePath (p ,c ,is_import ,pos ) ->
@@ -516,7 +530,14 @@ let compile_ctx callbacks ctx =
516
530
catch_completion_and_exit ctx callbacks run
517
531
518
532
let create_context comm cs compilation_step params = {
519
- com = Common. create compilation_step cs version params (DisplayTypes.DisplayMode. create ! Parser. display_mode);
533
+ com = Common. create compilation_step cs {
534
+ version = version;
535
+ major = version_major;
536
+ minor = version_minor;
537
+ revision = version_revision;
538
+ pre = version_pre;
539
+ extra = Version. version_extra;
540
+ } params (DisplayTypes.DisplayMode. create ! Parser. display_mode);
520
541
messages = [] ;
521
542
has_next = false ;
522
543
has_error = false ;
0 commit comments