Und da steht es ja auch schon genauso drin, daß es in dieser Situation crasht:
Zitat:
There is, however, a pitfall in the above example -
if the "inner" routine references any variable that was pushed onto
the stack before the "inner" procedure was called from testpass
(calltestpass parameters - if there were any, or local variables in
calltestpass - if there were any), your system most probably crashes:
Delphi-Quellcode:
{ This code compiles OK but generates runtime exception (could even be
EMachineHangs :-) ) }
procedure testpass(p: pointer);
begin
tProcedure(p);
end;
procedure calltestpass;
var msg:
string;
procedure inner;
begin
msg := '
hello';
showmessage(msg);
end;
begin
testpass(@inner);
end;