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
1c09a7c5
Commit
1c09a7c5
authored
Aug 26, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcp90: Don't use throw_exception helper for bad_alloc exception.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5630ce26
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
26 deletions
+21
-26
main.c
dlls/msvcp60/main.c
+1
-1
msvcp.h
dlls/msvcp60/msvcp.h
+1
-0
cxx.h
dlls/msvcp90/cxx.h
+0
-1
details.c
dlls/msvcp90/details.c
+1
-1
exception.c
dlls/msvcp90/exception.c
+12
-9
memory.c
dlls/msvcp90/memory.c
+2
-10
msvcp90.h
dlls/msvcp90/msvcp90.h
+2
-1
msvcp_main.c
dlls/msvcp90/msvcp_main.c
+2
-3
No files found.
dlls/msvcp60/main.c
View file @
1c09a7c5
...
...
@@ -65,7 +65,7 @@ void* (__cdecl *MSVCRT_set_new_handler)(void*);
void
*
__cdecl
operator_new
(
size_t
size
)
{
void
*
ret
=
MSVCRT_operator_new
(
size
);
if
(
!
ret
)
throw_exception
(
EXCEPTION_BAD_ALLOC
,
"bad allocation"
);
if
(
!
ret
)
_Xmem
(
);
return
ret
;
}
...
...
dlls/msvcp60/msvcp.h
View file @
1c09a7c5
...
...
@@ -485,3 +485,4 @@ typedef struct {
}
complex_double
;
void
WINAPI
DECLSPEC_NORETURN
_CxxThrowException
(
exception
*
,
const
cxx_exception_type
*
);
void
__cdecl
DECLSPEC_NORETURN
_Xmem
(
void
);
dlls/msvcp90/cxx.h
View file @
1c09a7c5
...
...
@@ -317,7 +317,6 @@ typedef struct __exception
/* Internal: throws selected exception */
typedef
enum
__exception_type
{
EXCEPTION
,
EXCEPTION_BAD_ALLOC
,
EXCEPTION_BAD_CAST
,
EXCEPTION_LOGIC_ERROR
,
EXCEPTION_LENGTH_ERROR
,
...
...
dlls/msvcp90/details.c
View file @
1c09a7c5
...
...
@@ -89,7 +89,7 @@ void __thiscall _Concurrent_queue_base_v4__Internal_throw_exception(
const
_Concurrent_queue_base_v4
*
this
)
{
TRACE
(
"(%p)
\n
"
,
this
);
throw_exception
(
EXCEPTION_BAD_ALLOC
,
NULL
);
_Xmem
(
);
}
/* ??0_Concurrent_queue_base_v4@details@Concurrency@@IAE@I@Z */
...
...
dlls/msvcp90/exception.c
View file @
1c09a7c5
...
...
@@ -867,17 +867,25 @@ DEFINE_RTTI_DATA2(range_error, 0, &runtime_error_rtti_base_descriptor, &exceptio
DEFINE_CXX_DATA2
(
range_error
,
&
runtime_error_cxx_type_info
,
&
exception_cxx_type_info
,
MSVCP_runtime_error_dtor
)
/* ?_Nomemory@std@@YAXXZ */
void
__cdecl
_Nomemory
(
void
)
void
__cdecl
DECLSPEC_NORETURN
_Nomemory
(
void
)
{
bad_alloc
e
;
TRACE
(
"()
\n
"
);
throw_exception
(
EXCEPTION_BAD_ALLOC
,
"bad allocation"
);
MSVCP_bad_alloc_default_ctor
(
&
e
);
_CxxThrowException
(
&
e
,
&
bad_alloc_cxx_type
);
}
/* ?_Xmem@tr1@std@@YAXXZ */
void
__cdecl
_Xmem
(
void
)
void
__cdecl
DECLSPEC_NORETURN
_Xmem
(
void
)
{
bad_alloc
e
;
TRACE
(
"()
\n
"
);
throw_exception
(
EXCEPTION_BAD_ALLOC
,
"bad allocation"
);
MSVCP_bad_alloc_default_ctor
(
&
e
);
_CxxThrowException
(
&
e
,
&
bad_alloc_cxx_type
);
}
/* ?_Xinvalid_argument@std@@YAXPBD@Z */
...
...
@@ -1048,11 +1056,6 @@ void throw_exception(exception_type et, const char *str)
MSVCP_exception_ctor
(
&
e
,
name
);
_CxxThrowException
(
&
e
,
&
exception_cxx_type
);
}
case
EXCEPTION_BAD_ALLOC
:
{
bad_alloc
e
;
MSVCP_bad_alloc_ctor
(
&
e
,
name
);
_CxxThrowException
(
&
e
,
&
bad_alloc_cxx_type
);
}
case
EXCEPTION_BAD_CAST
:
{
bad_cast
e
;
MSVCP_bad_cast_ctor
(
&
e
,
str
);
...
...
dlls/msvcp90/memory.c
View file @
1c09a7c5
...
...
@@ -170,11 +170,7 @@ void __thiscall MSVCP_allocator_wchar_deallocate(void *this,
DEFINE_THISCALL_WRAPPER
(
MSVCP_allocator_wchar_allocate
,
8
)
wchar_t
*
__thiscall
MSVCP_allocator_wchar_allocate
(
void
*
this
,
size_t
count
)
{
if
(
UINT_MAX
/
count
<
sizeof
(
wchar_t
))
{
throw_exception
(
EXCEPTION_BAD_ALLOC
,
NULL
);
return
NULL
;
}
if
(
UINT_MAX
/
count
<
sizeof
(
wchar_t
))
_Xmem
();
return
operator_new
(
count
*
sizeof
(
wchar_t
));
}
...
...
@@ -269,11 +265,7 @@ DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_allocate, 8)
unsigned
short
*
__thiscall
MSVCP_allocator_short_allocate
(
void
*
this
,
size_t
count
)
{
if
(
UINT_MAX
/
count
<
sizeof
(
unsigned
short
))
{
throw_exception
(
EXCEPTION_BAD_ALLOC
,
NULL
);
return
NULL
;
}
if
(
UINT_MAX
/
count
<
sizeof
(
unsigned
short
))
_Xmem
();
return
operator_new
(
count
*
sizeof
(
unsigned
short
));
}
...
...
dlls/msvcp90/msvcp90.h
View file @
1c09a7c5
...
...
@@ -663,4 +663,5 @@ static inline int mbstowcs_wrapper( size_t *ret, wchar_t *wcs, size_t size, cons
#define hypotf( x, y ) ((float)hypot( (double)(x), (double)(y) ))
#endif
void
WINAPI
_CxxThrowException
(
exception
*
,
const
cxx_exception_type
*
);
void
WINAPI
DECLSPEC_NORETURN
_CxxThrowException
(
exception
*
,
const
cxx_exception_type
*
);
void
__cdecl
DECLSPEC_NORETURN
_Xmem
(
void
);
dlls/msvcp90/msvcp_main.c
View file @
1c09a7c5
...
...
@@ -94,8 +94,7 @@ void* __cdecl operator_new(size_t size)
}
while
(
freed
);
TRACE
(
"(%Iu) out of memory
\n
"
,
size
);
throw_exception
(
EXCEPTION_BAD_ALLOC
,
"bad allocation"
);
return
NULL
;
_Xmem
();
}
void
__cdecl
operator_delete
(
void
*
mem
)
...
...
@@ -116,7 +115,7 @@ void* __cdecl operator_new(size_t size)
{
void
*
ret
=
MSVCRT_operator_new
(
size
);
#if _MSVCP_VER < 80
if
(
!
ret
)
throw_exception
(
EXCEPTION_BAD_ALLOC
,
"bad allocation"
);
if
(
!
ret
)
_Xmem
(
);
#endif
return
ret
;
}
...
...
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