fix #1381
This commit is contained in:
parent
705c8b6914
commit
aee5723c7e
|
|
@ -9685,8 +9685,20 @@ namespace PascalABCCompiler.NETGenerator
|
||||||
if (is_constructor || cur_meth.IsStatic == false) pos = (byte)pb.Position;
|
if (is_constructor || cur_meth.IsStatic == false) pos = (byte)pb.Position;
|
||||||
else pos = (byte)(pb.Position - 1);
|
else pos = (byte)(pb.Position - 1);
|
||||||
//***********************End of Kolay modified**********************
|
//***********************End of Kolay modified**********************
|
||||||
if (pos <= 255) il.Emit(OpCodes.Ldarga_S, pos);
|
if (value.parameter.parameter_type != parameter_type.var)
|
||||||
else il.Emit(OpCodes.Ldarga, pos);
|
{
|
||||||
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
18
TestSuite/pointers9.pas
Normal file
18
TestSuite/pointers9.pas
Normal 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.
|
||||||
Loading…
Reference in a new issue