Skip to content

Commit 492b82b

Browse files
GustavoLCRXVilka
authored andcommitted
Fixes for msvc demangling (radareorg#14695) ##bin
* Fix radareorg#12911 - Fix types starting with 'void' not being considered * Fix abbreviated names being lost
1 parent de7a488 commit 492b82b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

libr/bin/mangling/microsoft_demangle.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ int get_template (char *buf, SStrInfo *str_info) {
175175
if (!init_type_code_str_struct(&type_code_str)) {
176176
goto get_template_err;
177177
}
178-
abbr_names = r_list_new ();
179178

180179
// get/copy template len/name
181180
len += (tmp - buf + 1);
@@ -244,7 +243,7 @@ int get_namespace_and_name( char *buf, STypeCodeStr *type_code_str,
244243

245244
int len = 0, read_len = 0, tmp_len = 0;
246245

247-
names_l = r_list_new();
246+
names_l = r_list_new ();
248247

249248
#define SET_OPERATOR_CODE(str) { \
250249
str_info = (SStrInfo *) malloc (sizeof(SStrInfo)); \
@@ -1303,7 +1302,7 @@ static EDemanglerErr parse_microsoft_mangled_name(char *sym, char **demangled_na
13031302
curr_pos += i;
13041303
}
13051304

1306-
func_args = r_list_new();
1305+
func_args = r_list_new ();
13071306

13081307
// Function arguments
13091308
while (*curr_pos && *curr_pos != 'Z')
@@ -1337,7 +1336,7 @@ static EDemanglerErr parse_microsoft_mangled_name(char *sym, char **demangled_na
13371336

13381337
r_list_append (func_args, str_arg);
13391338

1340-
if (strncmp (tmp, "void", 4) == 0) {
1339+
if (strncmp (tmp, "void", 4) == 0 && strlen (tmp) == 4) {
13411340
// arguments list is void
13421341
if (!is_abbr_type) {
13431342
R_FREE (tmp);

0 commit comments

Comments
 (0)