You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We run this pascal script engine under x64 and register:
with CL.AddClass(CL.FindClass('TObject'), TPersistent) do
begin
RegisterMethod('Procedure Assign( Source : TPersistent)');
RegisterMethod('Function GetNamePath : string'); // this one
end;
and
with CL.Add(TPersistent) do
begin
RegisterVirtualMethod(@TPersistent.Assign, 'Assign');
RegisterVirtualMethod(@TPersistent.GetNamePath, 'GetNamePath');
end;
Then run a script like below:
program ScriptTest;
var
P: TPersistent;
begin
P := TPersistent.Create;
Writeln(P.GetNamePath);
P.Free;
end.
We'll get an AV:
Exception: Access violation at address 0000000000D8DECB in module 'ScriptTest.exe' (offset DECB). Read of address FFFFFFFFFFFFFF78
if under 32bit, AV also comes out .
Seems the reason is function GetNamePath: string; dynamic;
For dynamic functions, seems Pascal Script engine can not get it's correct entry address.
The text was updated successfully, but these errors were encountered:
cnpack
changed the title
AV occured if Registered Method returns string under x64 for a hidden parameter
Dynamic Method Not Support? AV occured.
Mar 21, 2025
We run this pascal script engine under x64 and register:
and
Then run a script like below:
We'll get an AV:
Exception: Access violation at address 0000000000D8DECB in module 'ScriptTest.exe' (offset DECB). Read of address FFFFFFFFFFFFFF78
if under 32bit, AV also comes out .
Seems the reason is function GetNamePath: string; dynamic;
For dynamic functions, seems Pascal Script engine can not get it's correct entry address.
The text was updated successfully, but these errors were encountered: