aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--awk.h5
-rw-r--r--profile.c2
3 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 92454f0c..b8b53118 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2020-06-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ Thanks to Andrew Schorr for suggestion of better way to
+ handle exec_count being a long long.
+
+ * awk.h (INSTRUCTION): Make new ldl member be the long long.
+ (exec_count): Is now ldl.
+ * profile.c (pprint): Fix printf of exec_count.
+
2020-06-08 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y: Fix `print $"2"' case. Thanks to Ed Morton
diff --git a/awk.h b/awk.h
index 515b524d..5ba6bb9f 100644
--- a/awk.h
+++ b/awk.h
@@ -758,7 +758,8 @@ typedef struct exp_instruction {
awk_value_t *(*efptr)(int num_actual_args,
awk_value_t *result,
struct awk_ext_func *finfo);
- long long dl;
+ long dl;
+ long long ldl; // for exec_count
char *name;
} d;
@@ -899,7 +900,7 @@ typedef struct exp_instruction {
/*------------------ pretty printing/profiling --------*/
/* Op_exec_count */
-#define exec_count d.dl
+#define exec_count d.ldl
/* Op_K_while */
#define while_body d.di
diff --git a/profile.c b/profile.c
index d3f6f84f..0e00b631 100644
--- a/profile.c
+++ b/profile.c
@@ -297,7 +297,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
ip2 = (pc + 1)->lasti;
if (do_profile && ip1->exec_count > 0)
- fprintf(prof_fp, " # %ld", ip1->exec_count);
+ fprintf(prof_fp, " # %lld", ip1->exec_count);
end_line(ip1);
skip_comment = true;