From 608c1d180a9e1d132287aacde015dfd0c8fa4953 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 31 Oct 2016 21:52:43 +0200 Subject: Fix some valgrind errors. --- awkgram.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'awkgram.c') 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; -- cgit v1.2.3