2 * Copyright 2010 Piotr Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(msvcp90
);
30 /* dlls/msvcrt/cppexcept.h */
31 typedef void (*cxx_copy_ctor
)(void);
33 /* complete information about a C++ type */
34 typedef struct __cxx_type_info
36 UINT flags
; /* flags (see CLASS_* flags below) */
37 const type_info
*type_info
; /* C++ type info */
38 this_ptr_offsets offsets
; /* offsets for computing the this pointer */
39 unsigned int size
; /* object size */
40 cxx_copy_ctor copy_ctor
; /* copy constructor */
42 #define CLASS_IS_SIMPLE_TYPE 1
43 #define CLASS_HAS_VIRTUAL_BASE_CLASS 4
45 /* table of C++ types that apply for a given object */
46 typedef struct __cxx_type_info_table
48 UINT count
; /* number of types */
49 const cxx_type_info
*info
[3]; /* variable length, we declare it large enough for static RTTI */
50 } cxx_type_info_table
;
52 /* type information for an exception object */
53 typedef struct __cxx_exception_type
55 UINT flags
; /* TYPE_FLAG flags */
56 void (*destructor
)(void);/* exception object destructor */
57 void* /*cxx_exc_custom_handler*/ custom_handler
; /* custom handler for this exception */
58 const cxx_type_info_table
*type_info_table
; /* list of types for this exception object */
61 void WINAPI
_CxxThrowException(exception
*,const cxx_exception_type
*);
64 extern const vtable_ptr MSVCP_bad_alloc_vtable
;
65 extern const vtable_ptr MSVCP_logic_error_vtable
;
66 extern const vtable_ptr MSVCP_length_error_vtable
;
67 extern const vtable_ptr MSVCP_out_of_range_vtable
;
68 extern const vtable_ptr MSVCP_invalid_argument_vtable
;
69 extern const vtable_ptr MSVCP_runtime_error_vtable
;
71 /* exception class data */
72 static type_info exception_type_info
= {
73 NULL
, /* set by set_exception_vtable */
78 DEFINE_THISCALL_WRAPPER(MSVCP_exception_ctor
, 8)
79 exception
* __thiscall
MSVCP_exception_ctor(exception
*this, const char **name
)
81 TRACE("(%p %s)\n", this, *name
);
83 this->vtable
= exception_type_info
.vtable
;
85 unsigned int name_len
= strlen(*name
) + 1;
86 this->name
= malloc(name_len
);
87 memcpy(this->name
, *name
, name_len
);
91 this->do_free
= FALSE
;
96 DEFINE_THISCALL_WRAPPER(MSVCP_exception_copy_ctor
,8)
97 exception
* __thiscall
MSVCP_exception_copy_ctor(exception
*this, const exception
*rhs
)
99 TRACE("(%p,%p)\n", this, rhs
);
102 this->vtable
= exception_type_info
.vtable
;
103 this->name
= rhs
->name
;
104 this->do_free
= FALSE
;
106 MSVCP_exception_ctor(this, (const char**)&rhs
->name
);
107 TRACE("name = %s\n", this->name
);
111 DEFINE_THISCALL_WRAPPER(MSVCP_exception_dtor
,4)
112 void __thiscall
MSVCP_exception_dtor(exception
*this)
114 TRACE("(%p)\n", this);
115 this->vtable
= exception_type_info
.vtable
;
120 static const rtti_base_descriptor exception_rtti_base_descriptor
= {
121 &exception_type_info
,
127 static const cxx_type_info exception_cxx_type_info
= {
129 &exception_type_info
,
132 (cxx_copy_ctor
)THISCALL(MSVCP_exception_dtor
)
135 static const cxx_type_info_table exception_cxx_type_table
= {
138 &exception_cxx_type_info
,
144 static const cxx_exception_type exception_cxx_type
= {
146 (cxx_copy_ctor
)THISCALL(MSVCP_exception_copy_ctor
),
148 &exception_cxx_type_table
151 void set_exception_vtable(void)
153 HMODULE hmod
= GetModuleHandleA("msvcrt.dll");
154 exception_type_info
.vtable
= (void*)GetProcAddress(hmod
, "??_7exception@@6B@");
157 /* bad_alloc class data */
158 typedef exception bad_alloc
;
160 DEFINE_THISCALL_WRAPPER(MSVCP_bad_alloc_ctor
, 8)
161 bad_alloc
* __thiscall
MSVCP_bad_alloc_ctor(bad_alloc
*this, const char **name
)
163 TRACE("%p %s\n", this, *name
);
164 MSVCP_exception_ctor(this, name
);
165 this->vtable
= &MSVCP_bad_alloc_vtable
;
169 DEFINE_THISCALL_WRAPPER(MSVCP_bad_alloc_copy_ctor
, 8)
170 bad_alloc
* __thiscall
MSVCP_bad_alloc_copy_ctor(bad_alloc
*this, const bad_alloc
*rhs
)
172 TRACE("%p %p\n", this, rhs
);
173 MSVCP_exception_copy_ctor(this, rhs
);
174 this->vtable
= &MSVCP_bad_alloc_vtable
;
178 DEFINE_THISCALL_WRAPPER(MSVCP_bad_alloc_dtor
, 4)
179 void __thiscall
MSVCP_bad_alloc_dtor(bad_alloc
*this)
182 MSVCP_exception_dtor(this);
185 DEFINE_THISCALL_WRAPPER(MSVCP_bad_alloc_vector_dtor
, 8)
186 void * __thiscall
MSVCP_bad_alloc_vector_dtor(bad_alloc
*this, unsigned int flags
)
188 TRACE("%p %x\n", this, flags
);
190 /* we have an array, with the number of elements stored before the first object */
191 int i
, *ptr
= (int *)this-1;
193 for(i
=*ptr
-1; i
>=0; i
--)
194 MSVCP_bad_alloc_dtor(this+i
);
195 MSVCRT_operator_delete(ptr
);
197 MSVCP_bad_alloc_dtor(this);
199 MSVCRT_operator_delete(this);
205 DEFINE_THISCALL_WRAPPER(MSVCP_what_exception
,4)
206 const char* __thiscall
MSVCP_what_exception(exception
* this)
208 TRACE("(%p) returning %s\n", this, this->name
);
209 return this->name
? this->name
: "Unknown exception";
212 static const type_info bad_alloc_type_info
= {
213 &MSVCP_bad_alloc_vtable
,
215 ".?AVbad_alloc@std@@"
218 static const rtti_base_descriptor bad_alloc_rtti_base_descriptor
= {
219 &bad_alloc_type_info
,
225 static const rtti_base_array bad_alloc_rtti_base_array
= {
227 &bad_alloc_rtti_base_descriptor
,
228 &exception_rtti_base_descriptor
,
233 static const rtti_object_hierarchy bad_alloc_type_hierarchy
= {
237 &bad_alloc_rtti_base_array
240 const rtti_object_locator bad_alloc_rtti
= {
244 &bad_alloc_type_info
,
245 &bad_alloc_type_hierarchy
248 static const cxx_type_info bad_alloc_cxx_type_info
= {
250 &bad_alloc_type_info
,
253 (cxx_copy_ctor
)THISCALL(MSVCP_bad_alloc_copy_ctor
)
256 static const cxx_type_info_table bad_alloc_cxx_type_table
= {
259 &bad_alloc_cxx_type_info
,
260 &exception_cxx_type_info
,
265 static const cxx_exception_type bad_alloc_cxx_type
= {
267 (cxx_copy_ctor
)THISCALL(MSVCP_bad_alloc_dtor
),
269 &bad_alloc_cxx_type_table
272 /* logic_error class data */
273 typedef struct _logic_error
{
275 basic_string_char str
;
278 DEFINE_THISCALL_WRAPPER(MSVCP_logic_error_ctor
, 8)
279 logic_error
* __thiscall
MSVCP_logic_error_ctor(
280 logic_error
*this, const char **name
)
282 TRACE("%p %s\n", this, *name
);
283 this->e
.vtable
= &MSVCP_logic_error_vtable
;
285 this->e
.do_free
= FALSE
;
286 MSVCP_basic_string_char_ctor_cstr(&this->str
, *name
);
290 DEFINE_THISCALL_WRAPPER(MSVCP_logic_error_copy_ctor
, 8)
291 logic_error
* __thiscall
MSVCP_logic_error_copy_ctor(
292 logic_error
*this, logic_error
*rhs
)
294 TRACE("%p %p\n", this, rhs
);
295 MSVCP_exception_copy_ctor(&this->e
, &rhs
->e
);
296 MSVCP_basic_string_char_copy_ctor(&this->str
, &rhs
->str
);
297 this->e
.vtable
= &MSVCP_logic_error_vtable
;
301 DEFINE_THISCALL_WRAPPER(MSVCP_logic_error_dtor
, 4)
302 void __thiscall
MSVCP_logic_error_dtor(logic_error
*this)
305 MSVCP_exception_dtor(&this->e
);
306 MSVCP_basic_string_char_dtor(&this->str
);
309 DEFINE_THISCALL_WRAPPER(MSVCP_logic_error_vector_dtor
, 8)
310 void* __thiscall
MSVCP_logic_error_vector_dtor(
311 logic_error
*this, unsigned int flags
)
313 TRACE("%p %x\n", this, flags
);
315 /* we have an array, with the number of elements stored before the first object */
316 int i
, *ptr
= (int *)this-1;
318 for(i
=*ptr
-1; i
>=0; i
--)
319 MSVCP_logic_error_dtor(this+i
);
320 MSVCRT_operator_delete(ptr
);
322 MSVCP_logic_error_dtor(this);
324 MSVCRT_operator_delete(this);
330 DEFINE_THISCALL_WRAPPER(MSVCP_logic_error_what
, 4)
331 const char* __thiscall
MSVCP_logic_error_what(logic_error
*this)
334 return MSVCP_basic_string_char_c_str(&this->str
);
337 static const type_info logic_error_type_info
= {
338 &MSVCP_logic_error_vtable
,
340 ".?AVlogic_error@std@@"
343 static const rtti_base_descriptor logic_error_rtti_base_descriptor
= {
344 &logic_error_type_info
,
350 static const rtti_base_array logic_error_rtti_base_array
= {
352 &logic_error_rtti_base_descriptor
,
353 &exception_rtti_base_descriptor
,
358 static const rtti_object_hierarchy logic_error_type_hierarchy
= {
362 &logic_error_rtti_base_array
365 const rtti_object_locator logic_error_rtti
= {
369 &logic_error_type_info
,
370 &logic_error_type_hierarchy
373 static const cxx_type_info logic_error_cxx_type_info
= {
375 &logic_error_type_info
,
378 (cxx_copy_ctor
)THISCALL(MSVCP_logic_error_copy_ctor
)
381 static const cxx_type_info_table logic_error_cxx_type_table
= {
384 &logic_error_cxx_type_info
,
385 &exception_cxx_type_info
,
390 static const cxx_exception_type logic_error_cxx_type
= {
392 (cxx_copy_ctor
)THISCALL(MSVCP_logic_error_dtor
),
394 &logic_error_cxx_type_table
397 /* length_error class data */
398 typedef logic_error length_error
;
400 DEFINE_THISCALL_WRAPPER(MSVCP_length_error_ctor
, 8)
401 length_error
* __thiscall
MSVCP_length_error_ctor(
402 length_error
*this, const char **name
)
404 TRACE("%p %s\n", this, *name
);
405 MSVCP_logic_error_ctor(this, name
);
406 this->e
.vtable
= &MSVCP_length_error_vtable
;
410 DEFINE_THISCALL_WRAPPER(MSVCP_length_error_copy_ctor
, 8)
411 length_error
* __thiscall
MSVCP_length_error_copy_ctor(
412 length_error
*this, length_error
*rhs
)
414 TRACE("%p %p\n", this, rhs
);
415 MSVCP_logic_error_copy_ctor(this, rhs
);
416 this->e
.vtable
= &MSVCP_length_error_vtable
;
420 DEFINE_THISCALL_WRAPPER(MSVCP_length_error_vector_dtor
, 8)
421 void* __thiscall
MSVCP_length_error_vector_dtor(
422 length_error
*this, unsigned int flags
)
424 TRACE("%p %x\n", this, flags
);
425 return MSVCP_logic_error_vector_dtor(this, flags
);
428 static const type_info length_error_type_info
= {
429 &MSVCP_length_error_vtable
,
431 ".?AVlength_error@std@@"
434 static const rtti_base_descriptor length_error_rtti_base_descriptor
= {
435 &length_error_type_info
,
441 static const rtti_base_array length_error_rtti_base_array
= {
443 &length_error_rtti_base_descriptor
,
444 &logic_error_rtti_base_descriptor
,
445 &exception_rtti_base_descriptor
449 static const rtti_object_hierarchy length_error_type_hierarchy
= {
453 &length_error_rtti_base_array
456 const rtti_object_locator length_error_rtti
= {
460 &length_error_type_info
,
461 &length_error_type_hierarchy
464 static const cxx_type_info length_error_cxx_type_info
= {
466 &length_error_type_info
,
468 sizeof(length_error
),
469 (cxx_copy_ctor
)THISCALL(MSVCP_length_error_copy_ctor
)
472 static const cxx_type_info_table length_error_cxx_type_table
= {
475 &length_error_cxx_type_info
,
476 &logic_error_cxx_type_info
,
477 &exception_cxx_type_info
481 static const cxx_exception_type length_error_cxx_type
= {
483 (cxx_copy_ctor
)THISCALL(MSVCP_logic_error_dtor
),
485 &length_error_cxx_type_table
488 /* out_of_range class data */
489 typedef logic_error out_of_range
;
491 DEFINE_THISCALL_WRAPPER(MSVCP_out_of_range_ctor
, 8)
492 out_of_range
* __thiscall
MSVCP_out_of_range_ctor(
493 out_of_range
*this, const char **name
)
495 TRACE("%p %s\n", this, *name
);
496 MSVCP_logic_error_ctor(this, name
);
497 this->e
.vtable
= &MSVCP_out_of_range_vtable
;
501 DEFINE_THISCALL_WRAPPER(MSVCP_out_of_range_copy_ctor
, 8)
502 out_of_range
* __thiscall
MSVCP_out_of_range_copy_ctor(
503 out_of_range
*this, out_of_range
*rhs
)
505 TRACE("%p %p\n", this, rhs
);
506 MSVCP_logic_error_copy_ctor(this, rhs
);
507 this->e
.vtable
= &MSVCP_out_of_range_vtable
;
511 DEFINE_THISCALL_WRAPPER(MSVCP_out_of_range_vector_dtor
, 8)
512 void* __thiscall
MSVCP_out_of_range_vector_dtor(
513 out_of_range
*this, unsigned int flags
)
515 TRACE("%p %x\n", this, flags
);
516 return MSVCP_logic_error_vector_dtor(this, flags
);
519 static const type_info out_of_range_type_info
= {
520 &MSVCP_out_of_range_vtable
,
522 ".?AVout_of_range@std@@"
525 static const rtti_base_descriptor out_of_range_rtti_base_descriptor
= {
526 &out_of_range_type_info
,
532 static const rtti_base_array out_of_range_rtti_base_array
= {
534 &out_of_range_rtti_base_descriptor
,
535 &logic_error_rtti_base_descriptor
,
536 &exception_rtti_base_descriptor
540 static const rtti_object_hierarchy out_of_range_type_hierarchy
= {
544 &out_of_range_rtti_base_array
547 const rtti_object_locator out_of_range_rtti
= {
551 &out_of_range_type_info
,
552 &out_of_range_type_hierarchy
555 static const cxx_type_info out_of_range_cxx_type_info
= {
557 &out_of_range_type_info
,
559 sizeof(out_of_range
),
560 (cxx_copy_ctor
)THISCALL(MSVCP_out_of_range_copy_ctor
)
563 static const cxx_type_info_table out_of_range_cxx_type_table
= {
566 &out_of_range_cxx_type_info
,
567 &logic_error_cxx_type_info
,
568 &exception_cxx_type_info
572 static const cxx_exception_type out_of_range_cxx_type
= {
574 (cxx_copy_ctor
)THISCALL(MSVCP_logic_error_dtor
),
576 &out_of_range_cxx_type_table
579 /* invalid_argument class data */
580 typedef logic_error invalid_argument
;
582 DEFINE_THISCALL_WRAPPER(MSVCP_invalid_argument_ctor
, 8)
583 invalid_argument
* __thiscall
MSVCP_invalid_argument_ctor(
584 invalid_argument
*this, const char **name
)
586 TRACE("%p %s\n", this, *name
);
587 MSVCP_logic_error_ctor(this, name
);
588 this->e
.vtable
= &MSVCP_invalid_argument_vtable
;
592 DEFINE_THISCALL_WRAPPER(MSVCP_invalid_argument_copy_ctor
, 8)
593 invalid_argument
* __thiscall
MSVCP_invalid_argument_copy_ctor(
594 invalid_argument
*this, invalid_argument
*rhs
)
596 TRACE("%p %p\n", this, rhs
);
597 MSVCP_logic_error_copy_ctor(this, rhs
);
598 this->e
.vtable
= &MSVCP_invalid_argument_vtable
;
602 DEFINE_THISCALL_WRAPPER(MSVCP_invalid_argument_vector_dtor
, 8)
603 void* __thiscall
MSVCP_invalid_argument_vector_dtor(
604 invalid_argument
*this, unsigned int flags
)
606 TRACE("%p %x\n", this, flags
);
607 return MSVCP_logic_error_vector_dtor(this, flags
);
610 static const type_info invalid_argument_type_info
= {
611 &MSVCP_invalid_argument_vtable
,
613 ".?AVinvalid_argument@std@@"
616 static const rtti_base_descriptor invalid_argument_rtti_base_descriptor
= {
617 &invalid_argument_type_info
,
623 static const rtti_base_array invalid_argument_rtti_base_array
= {
625 &invalid_argument_rtti_base_descriptor
,
626 &logic_error_rtti_base_descriptor
,
627 &exception_rtti_base_descriptor
631 static const rtti_object_hierarchy invalid_argument_type_hierarchy
= {
635 &invalid_argument_rtti_base_array
638 const rtti_object_locator invalid_argument_rtti
= {
642 &invalid_argument_type_info
,
643 &invalid_argument_type_hierarchy
646 static const cxx_type_info invalid_argument_cxx_type_info
= {
648 &invalid_argument_type_info
,
650 sizeof(invalid_argument
),
651 (cxx_copy_ctor
)THISCALL(MSVCP_invalid_argument_copy_ctor
)
654 static const cxx_type_info_table invalid_argument_cxx_type_table
= {
657 &invalid_argument_cxx_type_info
,
658 &logic_error_cxx_type_info
,
659 &exception_cxx_type_info
663 static const cxx_exception_type invalid_argument_cxx_type
= {
665 (cxx_copy_ctor
)THISCALL(MSVCP_logic_error_dtor
),
667 &invalid_argument_cxx_type_table
670 /* runtime_error class data */
673 basic_string_char str
;
676 DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_ctor
, 8)
677 runtime_error
* __thiscall
MSVCP_runtime_error_ctor(
678 runtime_error
*this, const char **name
)
680 TRACE("%p %s\n", this, *name
);
681 this->e
.vtable
= &MSVCP_runtime_error_vtable
;
683 this->e
.do_free
= FALSE
;
684 MSVCP_basic_string_char_ctor_cstr(&this->str
, *name
);
688 DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_copy_ctor
, 8)
689 runtime_error
* __thiscall
MSVCP_runtime_error_copy_ctor(
690 runtime_error
*this, runtime_error
*rhs
)
692 TRACE("%p %p\n", this, rhs
);
693 MSVCP_exception_copy_ctor(&this->e
, &rhs
->e
);
694 MSVCP_basic_string_char_copy_ctor(&this->str
, &rhs
->str
);
695 this->e
.vtable
= &MSVCP_runtime_error_vtable
;
699 DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_dtor
, 4)
700 void __thiscall
MSVCP_runtime_error_dtor(runtime_error
*this)
703 MSVCP_exception_dtor(&this->e
);
704 MSVCP_basic_string_char_dtor(&this->str
);
707 DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_vector_dtor
, 8)
708 void* __thiscall
MSVCP_runtime_error_vector_dtor(
709 runtime_error
*this, unsigned int flags
)
711 TRACE("%p %x\n", this, flags
);
713 /* we have an array, with the number of elements stored before the first object */
714 int i
, *ptr
= (int *)this-1;
716 for(i
=*ptr
-1; i
>=0; i
--)
717 MSVCP_runtime_error_dtor(this+i
);
718 MSVCRT_operator_delete(ptr
);
720 MSVCP_runtime_error_dtor(this);
722 MSVCRT_operator_delete(this);
728 static const type_info runtime_error_type_info
= {
729 &MSVCP_runtime_error_vtable
,
731 ".?AVruntime_error@std@@"
734 static const rtti_base_descriptor runtime_error_rtti_base_descriptor
= {
735 &runtime_error_type_info
,
741 static const rtti_base_array runtime_error_rtti_base_array
= {
743 &runtime_error_rtti_base_descriptor
,
744 &exception_rtti_base_descriptor
,
749 static const rtti_object_hierarchy runtime_error_type_hierarchy
= {
753 &runtime_error_rtti_base_array
756 const rtti_object_locator runtime_error_rtti
= {
760 &runtime_error_type_info
,
761 &runtime_error_type_hierarchy
764 static const cxx_type_info runtime_error_cxx_type_info
= {
766 &runtime_error_type_info
,
768 sizeof(runtime_error
),
769 (cxx_copy_ctor
)THISCALL(MSVCP_runtime_error_copy_ctor
)
772 static const cxx_type_info_table runtime_error_cxx_type_table
= {
775 &runtime_error_cxx_type_info
,
776 &exception_cxx_type_info
,
781 static const cxx_exception_type runtime_error_cxx_type
= {
783 (cxx_copy_ctor
)THISCALL(MSVCP_runtime_error_dtor
),
785 &runtime_error_cxx_type_table
788 DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_what
, 4)
789 const char* __thiscall
MSVCP_runtime_error_what(runtime_error
*this)
792 return MSVCP_basic_string_char_c_str(&this->str
);
796 void __asm_dummy_vtables(void) {
798 __ASM_VTABLE(bad_alloc
, VTABLE_ADD_FUNC(MSVCP_what_exception
));
799 __ASM_VTABLE(logic_error
, VTABLE_ADD_FUNC(MSVCP_logic_error_what
));
800 __ASM_VTABLE(length_error
, VTABLE_ADD_FUNC(MSVCP_logic_error_what
));
801 __ASM_VTABLE(out_of_range
, VTABLE_ADD_FUNC(MSVCP_logic_error_what
));
802 __ASM_VTABLE(invalid_argument
, VTABLE_ADD_FUNC(MSVCP_logic_error_what
));
803 __ASM_VTABLE(runtime_error
, VTABLE_ADD_FUNC(MSVCP_runtime_error_what
));
808 /* Internal: throws selected exception */
809 void throw_exception(exception_type et
, const char *str
)
811 const char *addr
= str
;
816 MSVCP_exception_ctor(&e
, &addr
);
817 _CxxThrowException(&e
, &exception_cxx_type
);
819 case EXCEPTION_BAD_ALLOC
: {
821 MSVCP_bad_alloc_ctor(&e
, &addr
);
822 _CxxThrowException(&e
, &bad_alloc_cxx_type
);
824 case EXCEPTION_LOGIC_ERROR
: {
826 MSVCP_logic_error_ctor(&e
, &addr
);
827 _CxxThrowException((exception
*)&e
, &logic_error_cxx_type
);
829 case EXCEPTION_LENGTH_ERROR
: {
831 MSVCP_length_error_ctor(&e
, &addr
);
832 _CxxThrowException((exception
*)&e
, &length_error_cxx_type
);
834 case EXCEPTION_OUT_OF_RANGE
: {
836 MSVCP_out_of_range_ctor(&e
, &addr
);
837 _CxxThrowException((exception
*)&e
, &out_of_range_cxx_type
);
839 case EXCEPTION_INVALID_ARGUMENT
: {
841 MSVCP_invalid_argument_ctor(&e
, &addr
);
842 _CxxThrowException((exception
*)&e
, &invalid_argument_cxx_type
);
844 case EXCEPTION_RUNTIME_ERROR
: {
846 MSVCP_runtime_error_ctor(&e
, &addr
);
847 _CxxThrowException((exception
*)&e
, &runtime_error_cxx_type
);