diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-06-21 22:03:01 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-06-21 22:03:01 +0300 |
commit | f57f0699d7193571233735ba691ba19fc072b7dc (patch) | |
tree | 324f8a3af40517cf6c345fafb8ae2a3e6c084658 /interpret.h | |
parent | 7c4eb55aea8028503a27cf0132de12257262f71a (diff) | |
download | egawk-f57f0699d7193571233735ba691ba19fc072b7dc.tar.gz egawk-f57f0699d7193571233735ba691ba19fc072b7dc.tar.bz2 egawk-f57f0699d7193571233735ba691ba19fc072b7dc.zip |
Fix typeof to not change untyped param to scalar.
Diffstat (limited to 'interpret.h')
-rw-r--r-- | interpret.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/interpret.h b/interpret.h index 03532f43..554a7663 100644 --- a/interpret.h +++ b/interpret.h @@ -144,6 +144,7 @@ top: case Op_push: case Op_push_arg: + case Op_push_arg_untyped: { NODE *save_symbol; bool isparam = false; @@ -175,8 +176,10 @@ top: case Node_var_new: uninitialized_scalar: - m->type = Node_var; - m->var_value = dupnode(Nnull_string); + if (op != Op_push_arg_untyped) { + m->type = Node_var; + m->var_value = dupnode(Nnull_string); + } if (do_lint) lintwarn(isparam ? _("reference to uninitialized argument `%s'") : @@ -187,7 +190,7 @@ uninitialized_scalar: break; case Node_var_array: - if (op == Op_push_arg) + if (op == Op_push_arg || op == Op_push_arg_untyped) PUSH(m); else fatal(_("attempt to use array `%s' in a scalar context"), |