diff --git a/src/interpret_functions.h b/src/interpret_functions.h index f07cc27784971510d1422793f18fc19fc6c04c8e..302ded6702207c29c56b4f1a8d5972772131b9ad 100644 --- a/src/interpret_functions.h +++ b/src/interpret_functions.h @@ -497,11 +497,12 @@ OPCODE1(F_CLEAR_2_LOCAL, "clear 2 local", 0, { }); OPCODE1(F_CLEAR_4_LOCAL, "clear 4 local", 0, { + struct svalue *locals = Pike_fp->locals; int e; - free_mixed_svalues(Pike_fp->locals + arg1, 4); + free_mixed_svalues(locals + arg1, 4); for(e = 0; e < 4; e++) { - SET_SVAL(Pike_fp->locals[arg1+e], PIKE_T_INT, NUMBER_NUMBER, integer, 0); + SET_SVAL(locals[arg1+e], PIKE_T_INT, NUMBER_NUMBER, integer, 0); } }); @@ -1920,11 +1921,12 @@ OPCODE2(F_GLOBAL_LOCAL_INDEX, "global[local]", I_UPDATE_SP, { }); OPCODE2(F_LOCAL_ARROW, "local->x", I_UPDATE_SP, { + struct pike_frame *fp = Pike_fp; LOCAL_VAR(struct svalue tmp); SET_SVAL(tmp, PIKE_T_STRING, 1, string, - Pike_fp->context->prog->strings[arg1]); + fp->context->prog->strings[arg1]); mark_free_svalue (Pike_sp++); - index_no_free(Pike_sp-1,Pike_fp->locals+arg2, &tmp); + index_no_free(Pike_sp-1,fp->locals+arg2, &tmp); print_return_value(); }); diff --git a/src/svalue.h b/src/svalue.h index 01132a1f9452f94fbf6d40d9070d9d8d849ccf9c..db5fe7c2e90516aff35511fcd19e4291e8b90591 100644 --- a/src/svalue.h +++ b/src/svalue.h @@ -106,9 +106,10 @@ struct svalue #define SET_SVAL(SVAL, TYPE, SUBTYPE, FIELD, EXPR) do { \ /* Set the type afterwards to avoid a clobbered \ * svalue in case EXPR throws. */ \ - (SVAL).u.FIELD = (EXPR); \ - SET_SVAL_TYPE((SVAL), (TYPE)); \ - SET_SVAL_SUBTYPE((SVAL), (SUBTYPE)); \ + struct svalue *__sptr = &(SVAL); \ + __sptr->u.FIELD = (EXPR); \ + SET_SVAL_TYPE(*__sptr, (TYPE)); \ + SET_SVAL_SUBTYPE(*__sptr, (SUBTYPE)); \ } while(0) #define INVALIDATE_SVAL(SVAL) SET_SVAL_TYPE(SVAL, 99) /* an invalid type */