`return` keyword in the end of `void` function for tail calls
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- compilers, reverse-engineering
Hướng nghiên cứu
No source file or test is named. Start by locating the decompiler logic that renders tail calls and void-returning functions, then trace the example where destory_wsa_ctx tail-calls my_virt_free. Done means a void tail call is displayed without a return keyword while non-void tail calls retain it, with coverage for this case.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version and Platform (required):
- Binary Ninja Version: 3.4.4151-dev
- OS: Windows 11, x64
Bug Description:
I think that functions that have void return value should not have return keyword in their end. It makes me think that it will return something. It doesn't happen when last function call is not tail call.
void __fastcall destory_wsa_ctx(struct wsa_ctx* wsa)
004065d4 WSACleanup()
004065e0 release_close_mtx(&wsa->mutex)
004065e8 my_heap_free2(&wsa->some_buffer)
004065f0 my_heap_free2(&wsa->rec_buf)
004065f8 return my_virt_free(wsa->domain) __tailcall
void __fastcall destory_wsa_ctx(struct wsa_ctx* wsa)
004065d1 56 push esi {__saved_esi}
004065d2 8bf1 mov esi, ecx
004065d4 ff1524934100 call dword [WSACleanup]
004065da 8d8ed8010000 lea ecx, [esi+0x1d8] {wsa_ctx::mutex}
004065e0 e876da0000 call release_close_mtx
004065e5 8d4e30 lea ecx, [esi+0x30] {wsa_ctx::some_buffer}
004065e8 e894daffff call my_heap_free2
004065ed 8d4e10 lea ecx, [esi+0x10] {wsa_ctx::rec_buf}
004065f0 e88cdaffff call my_heap_free2
004065f5 8b0e mov ecx, dword [esi {wsa_ctx::domain}]
004065f7 5e pop esi {__saved_esi}
004065f8 e920090000 jmp my_virt_free
my_virt_free is also a function that have void return value.
void __fastcall my_virt_free(void* addr)
00406f25 VirtualFree(addr, nullptr, MEM_RELEASE)
00406f1d 6800800000 push 0x8000 {var_4}
00406f22 6a00 push 0x0 {var_8}
00406f24 51 push ecx {var_c}
00406f25 ff1518924100 call dword [VirtualFree]
00406f2b c3 retn {__return_addr}
Expected Behavior:
I expect it to not show return keyword.
- Ngôn ngữ chính
- C++
- Star
- 1.3k
- Fork
- 298
- Merge trung bình
- 5 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 19
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Vector35/binaryninja-api
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Vector35/binaryninja-api#8540 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Vector35/binaryninja-api#8516 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Vector35/binaryninja-api#8503 ·
-
normalize time logs from WARP Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Vector35/binaryninja-api#8446 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Vector35/binaryninja-api#8444 ·
Tất cả issue của Vector35/binaryninja-api
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
autowarefoundation/autoware_universe#13413 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
automated-analysis bug memory-safety
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
gazebosim/gz-sensors#662 · 1 bình luận ·