pike.git/
src/
interpret.h
Branch:
Tag:
Non-build tags
All tags
No tags
2002-10-12
2002-10-12 11:53:47 by Henrik Grubbström (Grubba) <grubba@grubba.org>
938a5d55cc107417036604c32ecdf72754a3c61e (
27
lines) (+
26
/-
1
)
[
Show
|
Annotate
]
Branch:
7.9
Added STACK_LEVEL_{START,DONE,CHECK}() for easier stack level debug.
Rev: src/interpret.h:1.114
2:
|| This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: interpret.h,v 1.
113
2002/10/
11
01
:
39
:
32
nilsson
Exp $
+
|| $Id: interpret.h,v 1.
114
2002/10/
12
11:
53
:
47
grubba
Exp $
*/ #ifndef INTERPRET_H
158:
}while(0)
+
#ifdef PIKE_DEBUG
+
#define STACK_LEVEL_START(depth) \
+
do { \
+
struct svalue *save_stack_level = Pike_sp - (depth);
+
+
#define STACK_LEVEL_DONE(depth) \
+
STACK_LEVEL_CHECK(depth); \
+
} while(0)
+
+
#define STACK_LEVEL_CHECK(depth) \
+
do { \
+
if (Pike_sp != save_stack_level + (depth)) { \
+
Pike_fatal("Unexpected stack level! " \
+
"Actual: %d, expected: %d\n", \
+
DO_NOT_WARN((int)(Pike_sp - save_stack_level)), \
+
(depth)); \
+
} \
+
} while(0)
+
#else /* !PIKE_DEBUG */
+
#define STACK_LEVEL_START(depth) do {
+
#define STACK_LEVEL_DONE(depth) } while(0)
+
#define STACK_LEVEL_CHECK(depth)
+
#endif /* PIKE_DEBUG */
+
#define pop_stack() do{ free_svalue(--Pike_sp); debug_check_stack(); }while(0) #define pop_2_elems() do { pop_stack(); pop_stack(); }while(0)