[PATCH dwarves v3 5/9] dwarf_loader: Change exprlen checking condition in parameter__reg()

Yonghong Song
2026-03-20T19:09:54Z

The change does not change any functionalities. But it allows
DW_OP_stack_value preserved in longer location list for future
parameter checking.

Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
---
dwarf_loader.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dwarf_loader.c b/dwarf_loader.c
index c259417..117cd49 100644
--- a/dwarf_loader.c
+++ b/dwarf_loader.c
@@ -1227,7 +1227,7 @@ static int parameter__reg(Dwarf_Attribute *attr, int expected_reg, struct conf_l
* DW_OP_stack_value instructs interpreter to pop current value from
* DWARF expression evaluation stack, and thus is not important here.
*/
- if (exprlen > 1 && expr[exprlen - 1].atom == DW_OP_stack_value)
+ if (exprlen == 2 && expr[exprlen - 1].atom == DW_OP_stack_value)
exprlen--;

if (exprlen != 1)
--
2.52.0