From 68467da17d576a17e4ff96c60f581561ac0bbe88 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Fri, 2 Feb 2024 13:22:25 -0500 Subject: check for invalid integer conversions --- src/stdlib/llabs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/stdlib/llabs.c') diff --git a/src/stdlib/llabs.c b/src/stdlib/llabs.c index e60e34b5..3af9bcce 100644 --- a/src/stdlib/llabs.c +++ b/src/stdlib/llabs.c @@ -9,13 +9,15 @@ long long int llabs(long long int j) SIGNAL_SAFE(0); if (j == LLONG_MIN) { - /* undefined */ + UNDEFINED("In call to llabs(): The absolute value of LLONG_MIN is not representable as a long long int"); return LLONG_MIN; } return j < 0 ? -j : j; } +CHECK_1(long long int, 0, llabs, long long int) + /*** computes the absolute value of ARGUMENT(j). ***/ -- cgit v1.2.1