From aa2739bf1b9a045d94220b607c03b21dbbb7959d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 1 Jan 2021 12:57:26 -0800 Subject: [PATCH] Fix CCL_MOD typo * src/ccl.c (ccl_driver): Fix typo that disabled the checks for undefined behavior with integer remainder. Problem caught by Oracle Studio 12.6. --- src/ccl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ccl.c b/src/ccl.c index 629cb70294f..7c033afc882 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -1151,7 +1151,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size if (!INT_DIVIDE_OVERFLOW (reg[rrr], i)) reg[rrr] /= i; break; - case CCL_MOD: reg[rrr] %= i; break; + case CCL_MOD: if (!i) CCL_INVALID_CMD; reg[rrr] = i == -1 ? 0 : reg[rrr] % i; -- 2.39.5