aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2016-06-20 10:10:30 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2016-06-20 10:10:30 -0400
commit2d2744ec74076d29e94a2a004e308f73a86b9fa5 (patch)
tree0238d94fc263fd3cc6b2b9e5dc62204e5a985d5a /eval.c
parent239d7cc07ec54ec7a69805f9a674bfbbbd72f9b1 (diff)
downloadegawk-2d2744ec74076d29e94a2a004e308f73a86b9fa5.tar.gz
egawk-2d2744ec74076d29e94a2a004e308f73a86b9fa5.tar.bz2
egawk-2d2744ec74076d29e94a2a004e308f73a86b9fa5.zip
Call fixtype in a few more places to make sure we check types properly.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index ee674911..d7735205 100644
--- a/eval.c
+++ b/eval.c
@@ -712,7 +712,7 @@ set_BINMODE()
{
static bool warned = false;
char *p;
- NODE *v = BINMODE_node->var_value;
+ NODE *v = fixtype(BINMODE_node->var_value);
if ((do_lint || do_traditional) && ! warned) {
warned = true;
@@ -721,7 +721,6 @@ set_BINMODE()
if (do_traditional)
BINMODE = TEXT_TRANSLATE;
else if ((v->flags & NUMBER) != 0) {
- (void) force_number(v);
BINMODE = get_number_si(v);
/* Make sure the value is rational. */
if (BINMODE < TEXT_TRANSLATE)
@@ -1157,7 +1156,7 @@ r_get_field(NODE *n, Func_ptr *assign, bool reference)
if (assign)
*assign = NULL;
if (do_lint) {
- if ((n->flags & NUMBER) == 0) {
+ if ((fixtype(n)->flags & NUMBER) == 0) {
lintwarn(_("attempt to field reference from non-numeric value"));
if (n->stlen == 0)
lintwarn(_("attempt to field reference from null string"));