summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2022-01-18 11:56:45 +0000
committerDodji Seketeli <dodji@redhat.com>2022-01-18 16:58:18 +0100
commite825cef6e0da1567a0d762969e78d327cabc64fe (patch)
tree7787757bf8225e027340fb88514b8007e173ac6c
parentDWARF reader: use size_t for DWARF expression length (diff)
downloadlibabigail-e825cef6e0da1567a0d762969e78d327cabc64fe.tar.gz
libabigail-e825cef6e0da1567a0d762969e78d327cabc64fe.tar.bz2
libabigail-e825cef6e0da1567a0d762969e78d327cabc64fe.tar.xz
DWARF reader: use size_t for DWARF expression length cont.
A recent change broke 32-bit builds due to an implicit assumption that size_t == uint64_t. Note that size_t is part of the elfutils dwarf_getlocation* functions' types. The previous fix omitted some instances of uint64_t. This commit updates further functions to consistently use size_t for DWARF expression lengths and indexes. * src/abg-dwarf-reader.cc (eval_last_constant_dwarf_sub_expr): Change expr_len argument type to size_t. (op_pushes_constant_value): Update ops_len and index argument types to size_t. Update next_index argument type to size_t&. (op_pushes_non_constant_value): Likewise. (op_is_arith_logic): Update expr_len and index argument types to size_t. Update next_index argument type to size_t&. (op_is_control_flow): Likewise. Fixes: 16207c4af7bc ("Bug 28191 - Interpret DWARF 5 addrx locations") Signed-off-by: Giuliano Procida <gprocida@google.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
-rw-r--r--src/abg-dwarf-reader.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc
index 7ee8c04a..d8545b4c 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -363,7 +363,7 @@ die_is_at_class_scope(const read_context& ctxt,
363 Dwarf_Die& class_scope_die); 363 Dwarf_Die& class_scope_die);
364static bool 364static bool
365eval_last_constant_dwarf_sub_expr(Dwarf_Op* expr, 365eval_last_constant_dwarf_sub_expr(Dwarf_Op* expr,
366 uint64_t expr_len, 366 size_t expr_len,
367 int64_t& value, 367 int64_t& value,
368 bool& is_tls_address); 368 bool& is_tls_address);
369 369
@@ -7732,9 +7732,9 @@ die_location_expr(const Dwarf_Die* die,
7732/// value onto the DEVM stack, false otherwise. 7732/// value onto the DEVM stack, false otherwise.
7733static bool 7733static bool
7734op_pushes_constant_value(Dwarf_Op* ops, 7734op_pushes_constant_value(Dwarf_Op* ops,
7735 uint64_t ops_len, 7735 size_t ops_len,
7736 uint64_t index, 7736 size_t index,
7737 uint64_t& next_index, 7737 size_t& next_index,
7738 dwarf_expr_eval_context& ctxt) 7738 dwarf_expr_eval_context& ctxt)
7739{ 7739{
7740 ABG_ASSERT(index < ops_len); 7740 ABG_ASSERT(index < ops_len);
@@ -7896,9 +7896,9 @@ op_pushes_constant_value(Dwarf_Op* ops,
7896/// non-constant value onto the DEVM stack, false otherwise. 7896/// non-constant value onto the DEVM stack, false otherwise.
7897static bool 7897static bool
7898op_pushes_non_constant_value(Dwarf_Op* ops, 7898op_pushes_non_constant_value(Dwarf_Op* ops,
7899 uint64_t ops_len, 7899 size_t ops_len,
7900 uint64_t index, 7900 size_t index,
7901 uint64_t& next_index, 7901 size_t& next_index,
7902 dwarf_expr_eval_context& ctxt) 7902 dwarf_expr_eval_context& ctxt)
7903{ 7903{
7904 ABG_ASSERT(index < ops_len); 7904 ABG_ASSERT(index < ops_len);
@@ -8146,9 +8146,9 @@ op_manipulates_stack(Dwarf_Op* expr,
8146/// arithmetic or logic operation. 8146/// arithmetic or logic operation.
8147static bool 8147static bool
8148op_is_arith_logic(Dwarf_Op* expr, 8148op_is_arith_logic(Dwarf_Op* expr,
8149 uint64_t expr_len, 8149 size_t expr_len,
8150 uint64_t index, 8150 size_t index,
8151 uint64_t& next_index, 8151 size_t& next_index,
8152 dwarf_expr_eval_context& ctxt) 8152 dwarf_expr_eval_context& ctxt)
8153{ 8153{
8154 ABG_ASSERT(index < expr_len); 8154 ABG_ASSERT(index < expr_len);
@@ -8279,9 +8279,9 @@ op_is_arith_logic(Dwarf_Op* expr,
8279/// control flow operation, false otherwise. 8279/// control flow operation, false otherwise.
8280static bool 8280static bool
8281op_is_control_flow(Dwarf_Op* expr, 8281op_is_control_flow(Dwarf_Op* expr,
8282 uint64_t expr_len, 8282 size_t expr_len,
8283 uint64_t index, 8283 size_t index,
8284 uint64_t& next_index, 8284 size_t& next_index,
8285 dwarf_expr_eval_context& ctxt) 8285 dwarf_expr_eval_context& ctxt)
8286{ 8286{
8287 ABG_ASSERT(index < expr_len); 8287 ABG_ASSERT(index < expr_len);