PDA

View Full Version : raise at : undocumented (?) syntax



Chebmaster
12-07-2021, 05:09 AM
While studying for extending my exception handling hack (exceptions fall through try blocks in threads in a DLL in Linux in fpc 3.0.4) I found these... Unexpected forms in fpc 3.2.0 sources:

raise TObject(nil) at addr,frame;
Raise E at Address,Frame;

Wut.
No mention of any "at" at https://wiki.freepascal.org/Raise

It seems I was Doing It Wrong and my engine was crashing on x86_64 a lot because I didn't know you can raise exception at specific stack frame and do not have to do it... manually via horrifying phtagns?

Checking RunErrorToExcept in the sources of fpc 2.6.4... Yup. Raise E at Address,Frame;. It was always there.

Ñuño Martínez
03-08-2021, 11:36 AM
I've found it is mentioned in The raise statement (https://www.freepascal.org/docs-html/current/ref/refse118.html#x244-26800017.1) at the Free Pascal reference guide (https://www.freepascal.org/docs-html/current/ref/ref.html). Includes a nice example.