pike.git/
src/
interpret_functions.h
Branch:
Tag:
Non-build tags
All tags
No tags
2014-12-04
2014-12-04 19:27:06 by Per Hedbor <ph@opera.com>
eca88bbe9256eaeafb098875f33bfadfd183090b (
14
lines) (+
12
/-
2
)
[
Show
|
Annotate
]
Branch:
bill/master_archive_support
Check for destruction of object before allowing access to globals
357:
OPCODE1(F_PRIVATE_GLOBAL, "global <private>", I_UPDATE_SP, { struct svalue *sp;
-
sp = (
struct
svalue
*
)(
Pike_fp->current_object->storage + Pike_fp->context->storage_offset + arg1);
+
struct object *co = Pike_fp->current_object;
+
if(!co->prog) /* note: generate an error. */
+
object_low_set_index(co,0,0);
+
sp = (struct svalue *)(
co
->storage + Pike_fp->context->storage_offset + arg1);
push_svalue( sp ); print_return_value(); });
1084:
OPCODE1(F_ASSIGN_PRIVATE_GLOBAL_AND_POP, "assign private global and pop", I_UPDATE_SP, { struct svalue *tmp;
-
tmp = (
struct
svalue
*
)(
Pike_fp->current_object->storage + Pike_fp->context->storage_offset + arg1);
+
struct object *co = Pike_fp->current_object;
+
if(!co->prog) /* note: generate an error. */
+
object_low_set_index(co,0,0);
+
tmp = (struct svalue *)(
co
->storage + Pike_fp->context->storage_offset + arg1);
free_svalue(tmp); *tmp = *--Pike_sp; }); OPCODE1(F_ASSIGN_PRIVATE_GLOBAL, "assign private global", I_UPDATE_SP, { struct svalue *tmp;
-
+
struct object *co = Pike_fp->current_object;
+
if(!co->prog) /* note: generate an error. */
+
object_low_set_index(co,0,0);
tmp = (struct svalue *)(Pike_fp->current_object->storage + Pike_fp->context->storage_offset + arg1); assign_svalue( tmp, Pike_sp-1 ); });