Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
766085ed
Commit
766085ed
authored
Aug 31, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
Aug 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Correctly support space generation in pointers.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
parent
4e1b7cec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
27 deletions
+28
-27
cpp.c
dlls/msvcrt/tests/cpp.c
+2
-0
undname.c
dlls/msvcrt/undname.c
+26
-27
No files found.
dlls/msvcrt/tests/cpp.c
View file @
766085ed
...
...
@@ -1295,6 +1295,8 @@ static void test_demangle(void)
/* 132 */
{
"??$meth@FD@DD@CC@@QAE_NK@Z"
,
"public: bool __thiscall CC::DD::meth<short,char>(unsigned long)"
},
/* 133 */
{
"?func@@YAXPIFAH@Z"
,
"void __cdecl func(int __unaligned * __restrict)"
},
/* 135 */
{
"?x@@3PAY02HA"
,
"int (* x)[3]"
},
/* 136 */
{
"?Qux@Bar@@0PAPAP6AHPAV1@AAH1PAH@ZA"
,
"private: static int (__cdecl** * Bar::Qux)(class Bar *,int &,int &,int *)"
},
/* variation of 105: note white space handling! */
};
int
i
,
num_test
=
ARRAY_SIZE
(
test
);
char
*
name
;
...
...
dlls/msvcrt/undname.c
View file @
766085ed
...
...
@@ -77,11 +77,17 @@ struct parsed_symbol
unsigned
avail_in_first
;
/* number of available bytes in head block */
};
enum
datatype_e
{
DT_NO_LEADING_WS
=
0x01
,
};
/* Type for parsing mangled types */
struct
datatype_t
{
const
char
*
left
;
const
char
*
right
;
enum
datatype_e
flags
;
};
static
BOOL
symbol_demangle
(
struct
parsed_symbol
*
sym
);
...
...
@@ -407,6 +413,7 @@ static void append_extended_modifier(struct parsed_symbol *sym, const char **whe
static
void
get_extended_modifier
(
struct
parsed_symbol
*
sym
,
struct
datatype_t
*
xdt
)
{
xdt
->
left
=
xdt
->
right
=
NULL
;
xdt
->
flags
=
0
;
for
(;;)
{
switch
(
*
sym
->
current
)
...
...
@@ -455,25 +462,24 @@ static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym,
switch
(
modif
)
{
case
'A'
:
ref
=
"
&"
;
str_modif
=
NULL
;
break
;
case
'B'
:
ref
=
"
&"
;
str_modif
=
"
volatile"
;
break
;
case
'P'
:
ref
=
"
*"
;
str_modif
=
NULL
;
break
;
case
'Q'
:
ref
=
"
*"
;
str_modif
=
"
const"
;
break
;
case
'R'
:
ref
=
"
*"
;
str_modif
=
"
volatile"
;
break
;
case
'S'
:
ref
=
"
*"
;
str_modif
=
"
const volatile"
;
break
;
case
'?'
:
ref
=
NULL
;
str_modif
=
NULL
;
break
;
case
'$'
:
ref
=
"
&&"
;
str_modif
=
NULL
;
break
;
case
'A'
:
ref
=
"
&"
;
str_modif
=
NULL
;
break
;
case
'B'
:
ref
=
"
&"
;
str_modif
=
"
volatile"
;
break
;
case
'P'
:
ref
=
"
*"
;
str_modif
=
NULL
;
break
;
case
'Q'
:
ref
=
"
*"
;
str_modif
=
"
const"
;
break
;
case
'R'
:
ref
=
"
*"
;
str_modif
=
"
volatile"
;
break
;
case
'S'
:
ref
=
"
*"
;
str_modif
=
"
const volatile"
;
break
;
case
'?'
:
ref
=
NULL
;
str_modif
=
NULL
;
break
;
case
'$'
:
ref
=
"
&&"
;
str_modif
=
NULL
;
break
;
default:
return
FALSE
;
}
if
(
ref
||
str_modif
||
xdt
.
left
||
xdt
.
right
)
ct
->
left
=
str_printf
(
sym
,
" %s%s%s%s%s%s%s"
,
xdt
.
left
,
xdt
.
left
&&
ref
?
" "
:
NULL
,
ref
,
(
xdt
.
left
||
ref
)
&&
xdt
.
right
?
" "
:
NULL
,
xdt
.
right
,
(
xdt
.
left
||
ref
||
xdt
.
right
)
&&
str_modif
?
" "
:
NULL
,
str_modif
);
ct
->
left
=
str_printf
(
sym
,
"%s%s%s%s%s%s"
,
xdt
.
left
?
" "
:
NULL
,
xdt
.
left
,
ref
,
xdt
.
right
?
" "
:
NULL
,
xdt
.
right
,
str_modif
);
else
ct
->
left
=
NULL
;
ct
->
right
=
NULL
;
ct
->
flags
=
0
;
if
(
get_modifier
(
sym
,
&
xdt
))
{
...
...
@@ -490,10 +496,7 @@ static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym,
if
(
!
(
n1
=
get_number
(
sym
)))
return
FALSE
;
num
=
atoi
(
n1
);
if
(
ct
->
left
&&
ct
->
left
[
0
]
==
' '
&&
!
xdt
.
left
)
ct
->
left
++
;
ct
->
left
=
str_printf
(
sym
,
" (%s%s"
,
xdt
.
left
,
ct
->
left
);
ct
->
left
=
str_printf
(
sym
,
" (%s%s"
,
xdt
.
left
,
ct
->
left
&&
!
xdt
.
left
?
ct
->
left
+
1
:
ct
->
left
);
ct
->
right
=
")"
;
xdt
.
left
=
NULL
;
...
...
@@ -504,15 +507,9 @@ static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym,
/* Recurse to get the referred-to type */
if
(
!
demangle_datatype
(
sym
,
&
sub_ct
,
pmt_ref
,
FALSE
))
return
FALSE
;
if
(
xdt
.
left
)
ct
->
left
=
str_printf
(
sym
,
"%s %s%s"
,
sub_ct
.
left
,
xdt
.
left
,
ct
->
left
);
else
{
/* don't insert a space between duplicate '*' */
if
(
!
in_args
&&
ct
->
left
&&
ct
->
left
[
0
]
&&
ct
->
left
[
1
]
==
'*'
&&
sub_ct
.
left
[
strlen
(
sub_ct
.
left
)
-
1
]
==
'*'
)
ct
->
left
++
;
ct
->
left
=
str_printf
(
sym
,
"%s%s"
,
sub_ct
.
left
,
ct
->
left
);
}
if
(
sub_ct
.
flags
&
DT_NO_LEADING_WS
)
ct
->
left
++
;
ct
->
left
=
str_printf
(
sym
,
"%s%s%s%s"
,
sub_ct
.
left
,
xdt
.
left
?
" "
:
NULL
,
xdt
.
left
,
ct
->
left
);
if
(
sub_ct
.
right
)
ct
->
right
=
str_printf
(
sym
,
"%s%s"
,
ct
->
right
,
sub_ct
.
right
);
sym
->
stack
.
num
=
mark
;
}
...
...
@@ -814,7 +811,8 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
assert
(
ct
);
ct
->
left
=
ct
->
right
=
NULL
;
ct
->
flags
=
0
;
switch
(
dt
=
*
sym
->
current
++
)
{
case
'_'
:
...
...
@@ -938,6 +936,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
ct
->
left
=
str_printf
(
sym
,
"%s%s (%s*"
,
sub_ct
.
left
,
sub_ct
.
right
,
call_conv
);
ct
->
flags
=
DT_NO_LEADING_WS
;
ct
->
right
=
str_printf
(
sym
,
")%s"
,
args
);
}
else
goto
done
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment