aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-04-28 16:39:13 +0300
committerArnold D. Robbins <arnold@skeeve.com>2015-04-28 16:39:13 +0300
commitf088a3efc8aefc47f0bfe7824732aae4283b4c15 (patch)
treef659c23e2ec050036804246ebf40d56403bc1987 /eval.c
parent7bda05c66848de97a7b43aa3e37ff4336f1b3220 (diff)
downloadegawk-f088a3efc8aefc47f0bfe7824732aae4283b4c15.tar.gz
egawk-f088a3efc8aefc47f0bfe7824732aae4283b4c15.tar.bz2
egawk-f088a3efc8aefc47f0bfe7824732aae4283b4c15.zip
Make call-by-value work again for $0.
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 12776846..dfb99a4c 100644
--- a/eval.c
+++ b/eval.c
@@ -1325,7 +1325,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: