diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-07-20 09:33:21 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-07-30 00:41:56 +0200 |
commit | 23224687205076604c1e0e5829690a5b6e150c06 (patch) | |
tree | 501bd568d44ff355a469bfddd27e8bec6da087e1 | |
parent | 9c9a9ec383608287802bb2639a4ee6b7bbfd6793 (diff) |
program: fix reporting source position of first instruction
We must always report the chunk source position relative to the function
start offset, even if it is zero.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | program.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -100,14 +100,10 @@ uc_program_function_load(uc_program_t *prog, size_t id) size_t uc_program_function_srcpos(uc_function_t *fn, size_t off) { - size_t pos; - if (!fn) return 0; - pos = uc_chunk_debug_get_srcpos(&fn->chunk, off); - - return pos ? fn->srcpos + pos : 0; + return fn->srcpos + uc_chunk_debug_get_srcpos(&fn->chunk, off); } void |