/* (C) Copyright International Business Machines Corporation 8 May */
/* 1991.  All Rights Reserved. */
/*  */
/* See the file USERAGREEMENT distributed with this software for full */
/* terms and conditions of use. */
#ifndef lint
static char sccsinfo[] = "@(#)o_escape.c	1.4 3/11/92";
#endif

/*
** o_escape.c
*/

#include "ops.h"
#include "li.h"
#include "storage.h"
#include "accessors.h"
#include "sysdep.h"
#include "interpform.cd"

extern int chf_iadd;

NILOP(o_escape)
{
  void *interpreter;
  void *link_process();
  void che_endprocess();
  pcb *current;
  valcell code;

  current = args->sched->ready;
  code.record = current->code;
  interpreter = link_process(code);
  if (interpreter) {
    current->interpreter = interpreter;
    args->nextop = current->ip; /* do it right next time */
  }
  else
    /* load failure... depletion might be appropriate here, but this */
    /* typically happens before any of the program has been executed */
    /* (like the outer BLOCK statement), and in that case there are no */
    /* handlers established so raising any exception will cause the */
    /* interpreter to abort.  So termination seems to be the better */
    /* alternative. */
    che_endprocess(args->sched);
}
