summaryrefslogtreecommitdiffstats
path: root/dwarflint
diff options
context:
space:
mode:
authorPetr Machata <[email protected]>2011-03-08 23:24:53 +0100
committerPetr Machata <[email protected]>2011-03-08 23:24:53 +0100
commit36ec3954018af14b59c0fd44de7f0e66ac68101e (patch)
treee923a474e8ec5d87b0c51614c6c87b25bf823cf8 /dwarflint
parent9793864ba79b399c7713e8d44fa784843c60e83c (diff)
dwarflint: Don't let unterminated strings in .debug_str to high-level
Diffstat (limited to 'dwarflint')
-rw-r--r--dwarflint/check_debug_info.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/dwarflint/check_debug_info.cc b/dwarflint/check_debug_info.cc
index ce245911..7b936cb9 100644
--- a/dwarflint/check_debug_info.cc
+++ b/dwarflint/check_debug_info.cc
@@ -398,6 +398,7 @@ namespace
struct coverage *strings_coverage;
struct coverage *pc_coverage;
bool *need_rangesp;
+ int *retval_p;
};
typedef void (*value_check_cb_t) (uint64_t addr,
@@ -451,9 +452,12 @@ namespace
while (strp < data_end && *strp != 0)
++strp;
if (strp == data_end)
- wr_error (*ctx->where)
- << "string at .debug_str: " << pri::hex (addr)
- << " is not zero-terminated." << std::endl;
+ {
+ wr_error (*ctx->where)
+ << "string at .debug_str: " << pri::hex (addr)
+ << " is not zero-terminated." << std::endl;
+ *ctx->retval_p = -2;
+ }
if (ctx->strings_coverage != NULL)
ctx->strings_coverage->add (addr, strp - startp + 1);
@@ -532,7 +536,8 @@ namespace
local_die_refs,
strings, strings_coverage,
pc_coverage,
- need_rangesp
+ need_rangesp,
+ &retval
};
while (!read_ctx_eof (ctx))