forked from Imagelibrary/binutils-gdb
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user