aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-06-21 22:03:01 +0300
committerArnold D. Robbins <arnold@skeeve.com>2015-06-21 22:03:01 +0300
commitf57f0699d7193571233735ba691ba19fc072b7dc (patch)
tree324f8a3af40517cf6c345fafb8ae2a3e6c084658 /awkgram.c
parent7c4eb55aea8028503a27cf0132de12257262f71a (diff)
downloadegawk-f57f0699d7193571233735ba691ba19fc072b7dc.tar.gz
egawk-f57f0699d7193571233735ba691ba19fc072b7dc.tar.bz2
egawk-f57f0699d7193571233735ba691ba19fc072b7dc.zip
Fix typeof to not change untyped param to scalar.
Diffstat (limited to 'awkgram.c')
-rw-r--r--awkgram.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/awkgram.c b/awkgram.c
index 12f648ed..ade5ed6a 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -6697,10 +6697,14 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
if (arg->nexti == arg->lasti && arg->nexti->opcode == Op_push)
arg->nexti->opcode = Op_push_arg; /* argument may be array */
}
- } else if (r->builtin == do_isarray || r->builtin == do_typeof) {
+ } else if (r->builtin == do_isarray) {
arg = subn->nexti;
if (arg->nexti == arg->lasti && arg->nexti->opcode == Op_push)
arg->nexti->opcode = Op_push_arg; /* argument may be array */
+ } else if (r->builtin == do_typeof) {
+ arg = subn->nexti;
+ if (arg->nexti == arg->lasti && arg->nexti->opcode == Op_push)
+ arg->nexti->opcode = Op_push_arg_untyped; /* argument may be untyped */
} else if (r->builtin == do_intdiv
#ifdef HAVE_MPFR
|| r->builtin == MPF(intdiv)