aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-10-31 21:52:43 +0200
committerArnold D. Robbins <arnold@skeeve.com>2016-10-31 21:52:43 +0200
commit608c1d180a9e1d132287aacde015dfd0c8fa4953 (patch)
treeb12f74e3a2e0d57b2799f147182834a18f988d86 /awkgram.c
parente5abd6a16d42fc0f42277919a2d0a2c28476788c (diff)
downloadegawk-608c1d180a9e1d132287aacde015dfd0c8fa4953.tar.gz
egawk-608c1d180a9e1d132287aacde015dfd0c8fa4953.tar.bz2
egawk-608c1d180a9e1d132287aacde015dfd0c8fa4953.zip
Fix some valgrind errors.
Diffstat (limited to 'awkgram.c')
-rw-r--r--awkgram.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/awkgram.c b/awkgram.c
index 0ad0fac8..78839fe9 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -8619,7 +8619,12 @@ make_profile_number(double d, const char *str, size_t len)
n->stptr = estrdup(str, len + 1);
n->stptr[len] = '\0';
n->stlen = len;
- n->flags |= NUMCONSTSTR;
+ // Set STRCUR and n->stfmt for use when profiling
+ // (i.e., actually running the program) so that
+ // force_string() on this item will work ok.
+ // Thanks and a tip of the hatlo to valgrind.
+ n->flags |= (NUMCONSTSTR|STRCUR);
+ n->stfmt = STFMT_UNUSED;
}
return n;