From cba6c651e752cac543ceda0b3068586260e0e23b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Sun, 8 Feb 2015 20:27:58 +0100 Subject: [PATCH] Runtime: o_append_mapping() now cares about setters. Fixes testsuite test of F_APPEND_MAPPING. --- src/mapping.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mapping.c b/src/mapping.c index dcf35696db..07c35c8273 100644 --- a/src/mapping.c +++ b/src/mapping.c @@ -1876,6 +1876,8 @@ void o_append_mapping( INT32 args ) { struct svalue *lval = Pike_sp - args; struct svalue *val = lval + 2; + int lvalue_type; + #ifdef PIKE_DEBUG if (args < 3) { Pike_fatal("Too few arguments to o_append_mapping(): %d\n", args); @@ -1883,10 +1885,9 @@ void o_append_mapping( INT32 args ) #endif args -= 3; /* Note: val should always be a zero here! */ - lvalue_to_svalue_no_free(val, lval); + lvalue_type = lvalue_to_svalue_no_free(val, lval); - if (TYPEOF(*val) == T_MAPPING) - { + if ((TYPEOF(*val) == T_MAPPING) && (lvalue_type != PIKE_T_GET_SET)) { struct mapping *m = val->u.mapping; if( m->refs == 2 ) { -- GitLab