aboutsummaryrefslogtreecommitdiffstats
path: root/interpret.h
diff options
context:
space:
mode:
Diffstat (limited to 'interpret.h')
-rw-r--r--interpret.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/interpret.h b/interpret.h
index c652624a..8e0fdee0 100644
--- a/interpret.h
+++ b/interpret.h
@@ -140,8 +140,13 @@ top:
if (m->type == Node_param_list) {
isparam = true;
save_symbol = m = GET_PARAM(m->param_cnt);
- if (m->type == Node_array_ref)
+ if (m->type == Node_array_ref) {
+ if (m->orig_array->type == Node_var) {
+ /* gawk 'func f(x) { a = 10; print x; } BEGIN{ f(a) }' */
+ goto uninitialized_scalar;
+ }
m = m->orig_array;
+ }
}
switch (m->type) {
@@ -157,6 +162,7 @@ top:
break;
case Node_var_new:
+uninitialized_scalar:
m->type = Node_var;
m->var_value = dupnode(Nnull_string);
if (do_lint)