home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
program
/
compiler
/
nasm20b
/
nasm_src
/
p_debug.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-01-19
|
2KB
|
119 lines
/* ---------------------------------------------------------------------- */
/* Copyright (C) 1992 by Natürlich! */
/* This file is copyrighted! */
/* Refer to the documentation for details. */
/* ---------------------------------------------------------------------- */
#include <stdio.h>
#include <setjmp.h>
#include "defines.h"
#include "nasm.h"
#include "debug.h"
#include "labels.h"
#define KEINE_CODE_INNEREIEN
#include "code.h"
#include "fix.h"
#include "exprfast.h"
#include "op.h"
#include "ldebug.h"
extern label huge *h_global[SEP], huge *t_global[SEP], huge *l_global;
#if ! LINKER
extern label huge *h_local[SEP], huge *t_local[SEP], huge *l_local,
huge *h_macro[SEP], huge *t_macro[SEP], huge *l_macro;
#endif
jmp_buf escape;
#if ! VERSION
static check_imm( p)
imm huge *p;
{
if( p)
{
POINTER_CHECK( p);
POINTER_CHECK( p->block);
}
}
static check_fix( p)
fix huge *p;
{
POINTER_CHECK( p);
check_imm( p->imm);
POINTER_CHECK( p->poof.label);
}
#define SUSPICIOUS 8
static _check_expr( p, depth)
expr huge *p;
{
if( p)
{
if( ++depth == SUSPICIOUS)
{
nwarning("Suspicious recursion depth");
longjmp( escape, 1);
}
POINTER_CHECK( p);
_check_expr( p->l, depth);
_check_expr( p->r, depth);
}
}
static check_expr( p)
expr huge *p;
{
if( p)
{
while( ! p->fix)
p = p->zonk.t;
_check_expr( p, 0);
check_fix( p->zonk.fixp);
}
}
static label *this_label;
check_label( p)
label huge *p;
{
ref huge *r;
if( ! setjmp( escape))
{
this_label = p;
POINTER_CHECK( p);
POINTER_CHECK( p->before);
POINTER_CHECK( p->name);
for( r = p->refs; r; r = r->next)
check_expr( r->ref);
}
}
void check_trees()
{
label huge *p;
int i;
for( i = 0; i != SEP; i++)
for( p = h_global[ i]; p; p = p->next)
check_label( p);
# if ! LINKER
for( i = 0; i != SEP; i++)
for( p = h_local[ i]; p; p = p->next)
check_label( p);
for( i = 0; i != SEP; i++)
for( p = h_global[ i]; p; p = p->next)
check_label( p);
# endif
}
#endif