summaryrefslogtreecommitdiff
path: root/builtin.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2016-12-04 16:38:16 -0500
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2016-12-04 16:38:16 -0500
commit4a20341b487c17b49fc455ba37df84946eda38a7 (patch)
tree5c56acdfdf7ef40e9b07865dcf685029731a863c /builtin.c
parent2b9a30b2ab91ea465a649be0fd0927c2aebc67ff (diff)
downloadgawk-4a20341b487c17b49fc455ba37df84946eda38a7.tar.gz
Minor fixes to fixtype and do_typeof.
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/builtin.c b/builtin.c
index 5d7c3764..f71d71dd 100644
--- a/builtin.c
+++ b/builtin.c
@@ -3988,7 +3988,6 @@ do_typeof(int nargs)
deref = false;
break;
case Node_val:
- case Node_var:
switch (fixtype(arg)->flags & (STRING|NUMBER|USER_INPUT|REGEX)) {
case STRING:
res = "string";
@@ -4017,6 +4016,14 @@ do_typeof(int nargs)
res = "untyped";
deref = false;
break;
+ case Node_var:
+ /*
+ * Note: this doesn't happen because the function calling code
+ * in interpret.h pushes Node_var->var_value.
+ */
+ fatal(_("typeof: invalid argument type `%s'"),
+ nodetype2str(arg->type));
+ break;
default:
fatal(_("typeof: unknown argument type `%s'"),
nodetype2str(arg->type));