summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2025-12-14 23:31:10 +0800
committerruki <[email protected]>2025-12-14 23:31:10 +0800
commit151a3e8ffa8f60c86232c9cca769f3649f6d5b2e (patch)
treedb3426a63329f61a988c87dd851b98a313293541 /core/src
parent65d966f76661b4756a5154a44155a87ff7cdd0b0 (diff)
fix some pr issues
Diffstat (limited to 'core/src')
-rw-r--r--core/src/xmake/binutils/coff/deplibs.c6
-rw-r--r--core/src/xmake/binutils/macho/deplibs.c2
2 files changed, 3 insertions, 5 deletions
diff --git a/core/src/xmake/binutils/coff/deplibs.c b/core/src/xmake/binutils/coff/deplibs.c
index 969702e98..5339540cc 100644
--- a/core/src/xmake/binutils/coff/deplibs.c
+++ b/core/src/xmake/binutils/coff/deplibs.c
@@ -99,11 +99,8 @@ tb_bool_t xm_binutils_coff_deplibs(tb_stream_ref_t istream, tb_hize_t base_offse
if (!sections) {
if (header.nsects > 0) return tb_false;
- lua_newtable(lua);
return tb_true;
}
-
- lua_newtable(lua);
tb_size_t result_count = 0;
for (tb_uint16_t i = 0; i < header.nsects; i++) {
xm_coff_section_t* section = &sections[i];
@@ -143,7 +140,8 @@ tb_bool_t xm_binutils_coff_deplibs(tb_stream_ref_t istream, tb_hize_t base_offse
*/
if (!tb_stream_seek(istream, idt_offset)) {
- break;
+ if (sections) tb_free(sections);
+ return tb_false;
}
while (1) {
diff --git a/core/src/xmake/binutils/macho/deplibs.c b/core/src/xmake/binutils/macho/deplibs.c
index 77f4fd2f2..40d19b5cb 100644
--- a/core/src/xmake/binutils/macho/deplibs.c
+++ b/core/src/xmake/binutils/macho/deplibs.c
@@ -100,7 +100,7 @@ tb_bool_t xm_binutils_macho_deplibs(tb_stream_ref_t istream, tb_hize_t base_offs
tb_hize_t current_cmd_offset = tb_stream_offset(istream);
if (!tb_stream_bread(istream, (tb_byte_t*)&lc, sizeof(lc))) {
- break;
+ return tb_false;
}
xm_binutils_macho_swap_load_command(&lc, swap);