diff --git a/compiler/scandir.pas b/compiler/scandir.pas index 1b5ff29e5e..ef6c1c343f 100644 --- a/compiler/scandir.pas +++ b/compiler/scandir.pas @@ -855,7 +855,12 @@ unit scandir; maxheapsize_limit: longint; begin {$if defined(i8086)} - if current_settings.x86memorymodel in x86_far_data_models then + if target_info.system=system_i8086_win16 then + begin + heapsize_limit:=65520; + maxheapsize_limit:=65520; + end + else if current_settings.x86memorymodel in x86_far_data_models then begin heapsize_limit:=655360; maxheapsize_limit:=655360;