diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-04-28 16:39:13 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-04-28 16:39:13 +0300 |
commit | f088a3efc8aefc47f0bfe7824732aae4283b4c15 (patch) | |
tree | f659c23e2ec050036804246ebf40d56403bc1987 /eval.c | |
parent | 7bda05c66848de97a7b43aa3e37ff4336f1b3220 (diff) | |
download | egawk-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.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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: |