Select Git revision
string-malloc.c
docode.c 75.02 KiB
/*
|| 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.
*/
#include "global.h"
#include "las.h"
#include "program.h"
#include "pike_types.h"
#include "stralloc.h"
#include "interpret.h"
#include "constants.h"
#include "array.h"
#include "pike_macros.h"
#include "pike_error.h"
#include "pike_memory.h"
#include "svalue.h"
#include "pike_embed.h"
#include "builtin_functions.h"
#include "peep.h"
#include "docode.h"
#include "operators.h"
#include "object.h"
#include "opcodes.h"
#include "lex.h"
#include "mapping.h"
#include "multiset.h"
#include "pike_compiler.h"
static int do_docode2(node *n, int flags);
typedef void (*cleanup_func)(void *);
struct cleanup_frame
{
struct cleanup_frame *prev;
cleanup_func cleanup;
void *cleanup_arg;
int stack_depth;
};
struct statement_label_name
{
struct statement_label_name *next;
struct pike_string *str;
INT_TYPE line_number;
};
struct statement_label
{
struct statement_label *prev;
struct statement_label_name *name;
/* -2 in break_label is used to flag "open" statement_label entries.
* If an open entry is on top of the stack, it's used instead of a
* new one. That's used to associate statement labels to the
* following statement. */
INT32 break_label, continue_label;
int emit_break_label;
int stack_depth;
struct cleanup_frame *cleanups;
};
static struct statement_label top_statement_label_dummy =
{0, 0, -1, -1, 0, -1, 0};
static struct statement_label *current_label = &top_statement_label_dummy;
#ifdef PIKE_DEBUG
static int current_stack_depth = -4711;
#else
static int current_stack_depth = 0;