Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (R)
Guardian Procedure Calls Reference Manual522629-013
13-48
REFPARAM_BOUNDSCHECK_ Procedure
allocates more space for the segment. If no space is available,
REFPARAM_BOUNDSCHECK_ returns error 3.
To exclude address references from the stack area used by the calling procedure,
use DEFINES with the
framestart parameter as follows:
1. Invoke the _FRAME_EDGE_DEF DEFINE among the declarations in the
procedure.
2. Pass the names of the first and last parameters of the procedure to the
_FRAME_EDGE_DEF DEFINE. If the procedure has no parameters, invoke
_FRAME_EDGE_DEF (‘L’ - 2).
3. Pass _FRAME_EDGE as the
framestart parameter to
REFPARAM_BOUNDSCHECK_.
In a multithreaded process that uses multiple stack areas, checking is performed
only for the thread that calls REFPARAM_BOUNDSCHECK_.
Example
INT PROC TSTBND ( alpha,omega);
INT .EXT alpha;
FIXED omega;
BEGIN
_FRAME_EDGE_DEF ( alpha,omega );
IF REFPARAM_BOUNDSCHECK_(alpha,2D,_FRAME_EDGE,0) THEN
RETURN -1;
RETURN 0;
END;