pike.git
/
src
/
docode.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/docode.c:1:
/*\ ||| This file a part of Pike, and is copyright by Fredrik Hubinette ||| Pike is distributed as GPL (General Public License) ||| See the files COPYING and DISCLAIMER for more information. \*/ /**/ #include "global.h"
-
RCSID("$Id: docode.c,v 1.
103
2001/02/
05
21
:
13
:
10
grubba Exp $");
+
RCSID("$Id: docode.c,v 1.
104
2001/02/
19
23
:
49
:
59
grubba Exp $");
#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"
pike.git/src/docode.c:156:
DO_IF_DEBUG( \ if (new_label__.cleanups && \ new_label__.cleanups != (void *)(ptrdiff_t) -1) \ fatal("Cleanup frames still left in statement_label.\n")); \ } while (0) static INT32 current_switch_case; static INT32 current_switch_default; static INT32 current_switch_values_on_stack; static INT32 *current_switch_jumptable =0;
-
static struct pike_
string
*current_switch_type = NULL;
+
static struct pike_
type
*current_switch_type = NULL;
void upd_int(int offset, INT32 tmp) { MEMCPY(Pike_compiler->new_program->program+offset, (char *)&tmp,sizeof(tmp)); } INT32 read_int(int offset) { return EXTRACT_INT(Pike_compiler->new_program->program+offset); }
pike.git/src/docode.c:1004:
BLOCK_END; return 0; } case F_CAST: if(n->type==void_type_string) { DO_CODE_BLOCK(CAR(n)); return 0; }
-
tmp1=store_
prog_string
(n->
type
);
-
emit1(F_
STRING
, DO_NOT_WARN((INT32)tmp1));
+
{
+
struct svalue sv;
+
sv.type = T_TYPE;
+
sv.subtype = 0;
+
sv.u.type = n->type;
+
tmp1
=
store_
constant
(
&sv, 1,
n->
name
);
+
emit1(F_
CONSTANT
, DO_NOT_WARN((INT32)tmp1));
+
}
tmp1=do_docode(CAR(n),0); if(!tmp1) { emit0(F_CONST0); tmp1=1; } if(tmp1>1) do_pop(DO_NOT_WARN((INT32)(tmp1-1))); emit0(F_CAST); return 1; case F_SOFT_CAST: if (runtime_options & RUNTIME_CHECK_TYPES) {
-
tmp1 = store_
prog_string
(n->
type
);
-
emit1(F_
STRING
, DO_NOT_WARN((INT32)tmp1));
+
{
+
struct svalue sv;
+
sv.type = T_TYPE;
+
sv.subtype = 0;
+
sv.u.type = n->type;
+
tmp1 = store_
constant
(
&sv, 1,
n->
name
);
+
emit1(F_
CONSTANT
, DO_NOT_WARN((INT32)tmp1));
+
}
tmp1 = do_docode(CAR(n), 0); if (!tmp1) { emit0(F_CONST0); tmp1 = 1; } if (tmp1 > 1) do_pop(DO_NOT_WARN((INT32)(tmp1 - 1))); emit0(F_SOFT_CAST); return 1; } tmp1 = do_docode(CAR(n), flags); if (tmp1 > 1) do_pop(DO_NOT_WARN((INT32)(tmp1 - 1))); return !!tmp1;