summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-04-28 16:40:51 +0300
committerArnold D. Robbins <arnold@skeeve.com>2015-04-28 16:40:51 +0300
commitb4ef28f58688cf3c3a5878c595b6582144ee2cf1 (patch)
tree215345f53d438d6aa45fdf1a0c20f446ef7be2a8 /eval.c
parent8dedda4944d453e2b9fe3e6d0234f7cae1e894c7 (diff)
parentf088a3efc8aefc47f0bfe7824732aae4283b4c15 (diff)
downloadgawk-b4ef28f58688cf3c3a5878c595b6582144ee2cf1.tar.gz
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 2d820580..b50bcea8 100644
--- a/eval.c
+++ b/eval.c
@@ -1328,7 +1328,13 @@ setup_frame(INSTRUCTION *pc)
if (m->type == Node_param_list)
m = GET_PARAM(m->param_cnt);
-
+
+ /* $0 needs to be passed by value to a function */
+ if (m == fields_arr[0]) {
+ DEREF(m);
+ m = dupnode(m);
+ }
+
switch (m->type) {
case Node_var_new:
case Node_var_array: