This commit is contained in:
Бондарев Иван 2018-10-28 12:41:38 +01:00
parent 705c8b6914
commit aee5723c7e
2 changed files with 32 additions and 2 deletions

View file

@ -9685,8 +9685,20 @@ namespace PascalABCCompiler.NETGenerator
if (is_constructor || cur_meth.IsStatic == false) pos = (byte)pb.Position;
else pos = (byte)(pb.Position - 1);
//***********************End of Kolay modified**********************
if (pos <= 255) il.Emit(OpCodes.Ldarga_S, pos);
else il.Emit(OpCodes.Ldarga, pos);
if (value.parameter.parameter_type != parameter_type.var)
{
if (pos <= 255)
il.Emit(OpCodes.Ldarga_S, pos);
else
il.Emit(OpCodes.Ldarga, pos);
}
else
{
if (pos <= 255)
il.Emit(OpCodes.Ldarg_S, pos);
else
il.Emit(OpCodes.Ldarg, pos);
}
}
else
{

18
TestSuite/pointers9.pas Normal file
View file

@ -0,0 +1,18 @@
type
r1 = record end;
var h1: ^r1;
hh1: ^^r1;
procedure p1(var h: ^r1);
begin
var hh:=@h;
assert(hh = hh1);
assert(h = h1);
end;
begin
New(h1);
hh1 := @h1;
p1(h1);
end.