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.
typedef struct sframe_decoder_ctx sframe_decoder_ctx;
typedef struct sframe_encoder_ctx sframe_encoder_ctx;
-#define MAX_OFFSET_BYTES (SFRAME_FRE_OFFSET_4B * 2 * 3)
+#define MAX_NUM_STACK_OFFSETS 3
+
+#define MAX_OFFSET_BYTES \
+ ((SFRAME_FRE_OFFSET_4B * 2 * MAX_NUM_STACK_OFFSETS))
/* User interfacing SFrame Row Entry.
An abstraction provided by libsframe so the consumer is decoupled from
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;