Skip to content

Commit

Permalink
Bug 1248416 - add symbols for bad_function_call exception for C++ run…
Browse files Browse the repository at this point in the history
…times. r=nfroyd
  • Loading branch information
lsalzman committed Feb 25, 2016
1 parent c82951a commit 817d9c9
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/stl-headers
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ new
algorithm
atomic
deque
functional
ios
iosfwd
iostream
istream
iterator
limits
list
Expand Down
2 changes: 2 additions & 0 deletions config/system-headers
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ fstream
fstream.h
ft2build.h
fts.h
functional
gconf/gconf-client.h
Gdiplus.h
gdk/gdk.h
Expand Down Expand Up @@ -565,6 +566,7 @@ ios
iosfwd
iostream
iostream.h
istream
iterator
JavaControl.h
JavaEmbedding/JavaControl.h
Expand Down
6 changes: 6 additions & 0 deletions memory/mozalloc/msvc_raise_wrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,10 @@ moz_Xruntime_error(const char* what)
abort_from_exception("runtime_error", what);
}

MFBT_API __declspec(noreturn) void
moz_Xbad_function_call()
{
abort_from_exception("bad_function_call", "bad function call");
}

} // namespace std
7 changes: 6 additions & 1 deletion memory/mozalloc/msvc_raise_wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
# error "Unable to wrap _RAISE(); CRT _RAISE() already defined"
#endif
#ifdef _XUTILITY_
# error "Unabled to wrap _X[exception]"(); CRT versions already declared"
# error "Unable to wrap _X[exception](); CRT versions already declared"
#endif
#ifdef _FUNCTIONAL_
# error "Unable to wrap _Xbad_function_call(); CRT version already declared"
#endif

#include "mozilla/mozalloc_abort.h"
Expand All @@ -26,6 +29,8 @@
# define _Xout_of_range moz_Xout_of_range
# define _Xoverflow_error moz_Xoverflow_error
# define _Xruntime_error moz_Xruntime_error
// used by <functional>
# define _Xbad_function_call moz_Xbad_function_call

# include <xstddef>
# include <xutility>
Expand Down
7 changes: 7 additions & 0 deletions memory/mozalloc/throw_gcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ __throw_bad_typeid(void)
mozalloc_abort("fatal: STL threw bad_typeid");
}

// used by <functional>
MOZ_NORETURN MOZ_ALWAYS_INLINE void
__throw_bad_function_call(void)
{
mozalloc_abort("fatal: STL threw bad_function_call");
}

MOZ_NORETURN MOZ_ALWAYS_INLINE void
__throw_logic_error(const char* msg)
{
Expand Down

0 comments on commit 817d9c9

Please sign in to comment.