Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
731dca90
Commit
731dca90
authored
Aug 27, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcp90: Use throw_exception helper to throw exception object only.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d7e91900
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
32 deletions
+9
-32
cxx.h
dlls/msvcp90/cxx.h
+0
-8
exception.c
dlls/msvcp90/exception.c
+7
-23
misc.c
dlls/msvcp90/misc.c
+1
-1
msvcp90.h
dlls/msvcp90/msvcp90.h
+1
-0
No files found.
dlls/msvcp90/cxx.h
View file @
731dca90
...
...
@@ -314,14 +314,6 @@ typedef struct __exception
int
do_free
;
/* Whether to free 'name' in our dtor */
}
exception
;
/* Internal: throws selected exception */
typedef
enum
__exception_type
{
EXCEPTION
,
EXCEPTION_BAD_CAST
,
EXCEPTION_LOGIC_ERROR
,
}
exception_type
;
void
throw_exception
(
exception_type
,
const
char
*
);
/* rtti */
typedef
struct
__type_info
{
...
...
dlls/msvcp90/exception.c
View file @
731dca90
...
...
@@ -399,7 +399,7 @@ DEFINE_RTTI_DATA1(logic_error, 0, &exception_rtti_base_descriptor, ".?AVlogic_er
#else
DEFINE_RTTI_DATA1
(
logic_error
,
0
,
&
exception_rtti_base_descriptor
,
".?AVlogic_error@@"
)
#endif
DEFINE_CXX_
DATA1
(
logic_error
,
&
exception_cxx_type_info
,
MSVCP_logic_error_dt
or
)
DEFINE_CXX_
TYPE_INFO
(
logic_err
or
)
/* length_error class data */
typedef
logic_error
length_error
;
...
...
@@ -817,7 +817,6 @@ bad_cast* __thiscall MSVCP_bad_cast_opequals(bad_cast *this, const bad_cast *rhs
}
DEFINE_RTTI_DATA1
(
bad_cast
,
0
,
&
exception_rtti_base_descriptor
,
".?AVbad_cast@std@@"
)
DEFINE_CXX_DATA1
(
bad_cast
,
&
exception_cxx_type_info
,
MSVCP_bad_cast_dtor
)
/* range_error class data */
typedef
runtime_error
range_error
;
...
...
@@ -1065,28 +1064,14 @@ __ASM_BLOCK_BEGIN(exception_vtables)
VTABLE_ADD_FUNC
(
MSVCP_runtime_error_what
));
__ASM_BLOCK_END
/* Internal: throws
selected
exception */
void
throw_exception
(
exception_type
et
,
const
char
*
str
)
/* Internal: throws exception */
void
DECLSPEC_NORETURN
throw_exception
(
const
char
*
str
)
{
exception_name
name
=
EXCEPTION_NAME
(
str
);
exception
e
;
switch
(
et
)
{
case
EXCEPTION
:
{
exception
e
;
MSVCP_exception_ctor
(
&
e
,
name
);
_CxxThrowException
(
&
e
,
&
exception_cxx_type
);
}
case
EXCEPTION_BAD_CAST
:
{
bad_cast
e
;
MSVCP_bad_cast_ctor
(
&
e
,
str
);
_CxxThrowException
(
&
e
,
&
bad_cast_cxx_type
);
}
case
EXCEPTION_LOGIC_ERROR
:
{
logic_error
e
;
MSVCP_logic_error_ctor
(
&
e
,
name
);
_CxxThrowException
(
&
e
,
&
logic_error_cxx_type
);
}
}
MSVCP_exception_ctor
(
&
e
,
name
);
_CxxThrowException
(
&
e
,
&
exception_cxx_type
);
}
/* Internal: throws range_error exception */
...
...
@@ -1132,7 +1117,7 @@ void init_exception(void *base)
init_exception_cxx
(
base
);
init_bad_alloc_cxx
(
base
);
init_logic_error_cxx
(
base
);
init_logic_error_cxx
_type_info
(
base
);
init_length_error_cxx
(
base
);
init_out_of_range_cxx
(
base
);
init_invalid_argument_cxx
(
base
);
...
...
@@ -1144,7 +1129,6 @@ void init_exception(void *base)
init_system_error_cxx_type_info
(
base
);
#endif
init_failure_cxx
(
base
);
init_bad_cast_cxx
(
base
);
init_range_error_cxx
(
base
);
#endif
}
dlls/msvcp90/misc.c
View file @
731dca90
...
...
@@ -700,7 +700,7 @@ unsigned int __cdecl _Random_device(void)
/* TODO: throw correct exception in case of failure */
if
(
rand_s
(
&
ret
))
throw_exception
(
EXCEPTION
,
"random number generator failed
\n
"
);
throw_exception
(
"random number generator failed
\n
"
);
return
ret
;
}
#endif
...
...
dlls/msvcp90/msvcp90.h
View file @
731dca90
...
...
@@ -669,5 +669,6 @@ void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*);
void
__cdecl
DECLSPEC_NORETURN
_Xmem
(
void
);
void
__cdecl
DECLSPEC_NORETURN
_Xout_of_range
(
const
char
*
);
void
__cdecl
DECLSPEC_NORETURN
_Xruntime_error
(
const
char
*
);
void
DECLSPEC_NORETURN
throw_exception
(
const
char
*
);
void
DECLSPEC_NORETURN
throw_failure
(
const
char
*
);
void
DECLSPEC_NORETURN
throw_range_error
(
const
char
*
);
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