home *** CD-ROM | disk | FTP | other *** search
- { STACKEAT.PAS }
- {
- Description: Program demonstrating what happens when a routine is called
- recursively, without any checks and balances.
-
- Author: Don Taylor
- Date: 4/4/88
- Last revised: 04/04/88 10:25
- Application: IBM PC and compatibles; Turbo Pascal 4.0
-
- }
-
- PROGRAM StackEater;
-
- USES
- Crt;
-
- {--------------------}
-
- PROCEDURE WhatNext;
-
- BEGIN
- WRITELN('This message should never appear!')
- END; { WhatNext }
-
- {--------------------}
-
- PROCEDURE WhizBang;
-
- VAR
- a,b,c : WORD;
- d : ARRAY[1..1024] OF INTEGER;
-
- BEGIN
- WRITELN('Calling WhizBang...');
- WhizBang;
- WhatNext
- END; { WhizBang }
-
- {====================}
-
- BEGIN { StackEater }
- ClrScr;
- WRITELN('Starting...');
- WhizBang;
- WRITELN('This line will not appear, either...')
- END. { StackEater }
-