From d987df5c95340a8b41b23d68ad6a8f9f33485835 Mon Sep 17 00:00:00 2001 From: Indu Bhagat Date: Thu, 1 Jun 2023 09:41:04 -0700 Subject: libsframe: avoid using magic number Define a new constant for the maximum number of stack offsets handled in libsframe, and use it. Note that the SFrame format does not define such a constant (limit). This is an implmentation-defined constant in libsframe. include/ * sframe-api.h (MAX_NUM_STACK_OFFSETS): New definition. libsframe/ * sframe.c (sframe_fre_sanity_check_p): Use it. --- libsframe/sframe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libsframe') diff --git a/libsframe/sframe.c b/libsframe/sframe.c index 97b4910..a97c64f 100644 --- a/libsframe/sframe.c +++ b/libsframe/sframe.c @@ -299,7 +299,7 @@ sframe_fre_sanity_check_p (sframe_frame_row_entry *frep) return false; offset_cnt = sframe_fre_get_offset_count (fre_info); - if (offset_cnt > 3) + if (offset_cnt > MAX_NUM_STACK_OFFSETS) return false; return true; -- cgit v1.1