From: Giuliano Procida <gprocida@google.com>
To: libabigail@sourceware.org
Cc: dodji@seketeli.org, kernel-team@android.com, gprocida@google.com,
maennich@google.com, Mark Wielaard <mark@klomp.org>
Subject: [PATCH] DWARF reader: use size_t for DWARF expression length cont.
Date: Tue, 18 Jan 2022 11:56:45 +0000 [thread overview]
Message-ID: <20220118115645.900414-1-gprocida@google.com> (raw)
From: Mark Wielaard <mark@klomp.org>
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>
---
src/abg-dwarf-reader.cc | 26 +++++++++++++-------------
1 file 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,
Dwarf_Die& class_scope_die);
static bool
eval_last_constant_dwarf_sub_expr(Dwarf_Op* expr,
- uint64_t expr_len,
+ size_t expr_len,
int64_t& value,
bool& is_tls_address);
@@ -7732,9 +7732,9 @@ die_location_expr(const Dwarf_Die* die,
/// value onto the DEVM stack, false otherwise.
static bool
op_pushes_constant_value(Dwarf_Op* ops,
- uint64_t ops_len,
- uint64_t index,
- uint64_t& next_index,
+ size_t ops_len,
+ size_t index,
+ size_t& next_index,
dwarf_expr_eval_context& ctxt)
{
ABG_ASSERT(index < ops_len);
@@ -7896,9 +7896,9 @@ op_pushes_constant_value(Dwarf_Op* ops,
/// non-constant value onto the DEVM stack, false otherwise.
static bool
op_pushes_non_constant_value(Dwarf_Op* ops,
- uint64_t ops_len,
- uint64_t index,
- uint64_t& next_index,
+ size_t ops_len,
+ size_t index,
+ size_t& next_index,
dwarf_expr_eval_context& ctxt)
{
ABG_ASSERT(index < ops_len);
@@ -8146,9 +8146,9 @@ op_manipulates_stack(Dwarf_Op* expr,
/// arithmetic or logic operation.
static bool
op_is_arith_logic(Dwarf_Op* expr,
- uint64_t expr_len,
- uint64_t index,
- uint64_t& next_index,
+ size_t expr_len,
+ size_t index,
+ size_t& next_index,
dwarf_expr_eval_context& ctxt)
{
ABG_ASSERT(index < expr_len);
@@ -8279,9 +8279,9 @@ op_is_arith_logic(Dwarf_Op* expr,
/// control flow operation, false otherwise.
static bool
op_is_control_flow(Dwarf_Op* expr,
- uint64_t expr_len,
- uint64_t index,
- uint64_t& next_index,
+ size_t expr_len,
+ size_t index,
+ size_t& next_index,
dwarf_expr_eval_context& ctxt)
{
ABG_ASSERT(index < expr_len);
--
2.34.1.703.g22d0c6ccf7-goog
next reply other threads:[~2022-01-18 11:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-18 11:56 Giuliano Procida [this message]
2022-01-18 15:58 ` Dodji Seketeli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220118115645.900414-1-gprocida@google.com \
--to=gprocida@google.com \
--cc=dodji@seketeli.org \
--cc=kernel-team@android.com \
--cc=libabigail@sourceware.org \
--cc=maennich@google.com \
--cc=mark@klomp.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).