remobjects / pascalscript

pascalscript
Other
447 stars 178 forks source link

Invoke Null procedure encounter error "Could not call proc" #232

Closed ccy closed 2 years ago

ccy commented 4 years ago

Run the following script:

var v: variant;
begin
  v := Null;
end.

prompt "Could not call proc" error in Delphi 10.4. I didn't try other Delphi release.

This happen from commit 86a057c8

pjrobin commented 4 years ago

@evgeny-k ?

jozunav commented 4 years ago

the same error Delphi 10.4

pjrobin commented 2 years ago

found a fix: in invokeCall.inc function TPSExec.InnerfuseCall, result type variant is not implemented. adding the following code after line 188 fixed the issue:

      btVariant:
      begin
        PVariant(res.dta)^ := Invoke(Address,Args,SysCalConv,TypeInfo(Variant),False,IsConstr).AsVariant;
      end;