* [PATCH] DWARF reader: use size_t for more DWARF expression length
@ 2022-01-18 13:03 Mark J. Wielaard
2022-01-18 13:14 ` Mark Wielaard
0 siblings, 1 reply; 2+ messages in thread
From: Mark J. Wielaard @ 2022-01-18 13:03 UTC (permalink / raw)
To: libabigail; +Cc: Giuliano Procida, Mark Wielaard
From: Mark Wielaard <mark@klomp.org>
commit 6e0d3f7 "DWARF reader: use size_t for DWARF expression
length" is a partial fix for the assumption that size_t == uint64_t.
This commit updates a couple more functions where this (wrong)
assumption was made.
* src/abg-dwarf-reader.cc (eval_last_constant_dwarf_sub_expr):
Change expr_len argument type to size_t*.
(op_pushes_constant_value): Change ops_len and index argument
types to size_t; change next_index argument type to size_t&.
(op_pushes_non_constant_value): Likewise.
(op_is_arith_logic): Change expr_len and index argument
types to size_t; change next_index argument type to size_t&.
(op_is_control_flow): Likewise.
Fixes: 16207c4af7bc ("Bug 28191 - Interpret DWARF 5 addrx locations")
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
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.18.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] DWARF reader: use size_t for more DWARF expression length
2022-01-18 13:03 [PATCH] DWARF reader: use size_t for more DWARF expression length Mark J. Wielaard
@ 2022-01-18 13:14 ` Mark Wielaard
0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2022-01-18 13:14 UTC (permalink / raw)
To: libabigail
Hi,
On Tue, 2022-01-18 at 14:03 +0100, Mark J. Wielaard wrote:
> From: Mark Wielaard <mark@klomp.org>
>
> commit 6e0d3f7 "DWARF reader: use size_t for DWARF expression
> length" is a partial fix for the assumption that size_t == uint64_t.
>
> This commit updates a couple more functions where this (wrong)
> assumption was made.
>
> * src/abg-dwarf-reader.cc (eval_last_constant_dwarf_sub_expr):
> Change expr_len argument type to size_t*.
> (op_pushes_constant_value): Change ops_len and index argument
> types to size_t; change next_index argument type to size_t&.
> (op_pushes_non_constant_value): Likewise.
> (op_is_arith_logic): Change expr_len and index argument
> types to size_t; change next_index argument type to size_t&.
> (op_is_control_flow): Likewise.
>
> Fixes: 16207c4af7bc ("Bug 28191 - Interpret DWARF 5 addrx locations")
> Signed-off-by: Mark Wielaard <mark@klomp.org>
Sorry, this is equivalent to Giuliano's patch in
https://sourceware.org/pipermail/libabigail/2022q1/004114.html
I was confused about was was/wasn't committed.
Cheers,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-18 13:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18 13:03 [PATCH] DWARF reader: use size_t for more DWARF expression length Mark J. Wielaard
2022-01-18 13:14 ` Mark Wielaard
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).